pricing rule: condition for tree-type docs
This commit is contained in:
parent
ed5f423e65
commit
3319170805
@ -281,16 +281,16 @@ def get_pricing_rules(args_dict):
|
|||||||
|
|
||||||
|
|
||||||
conditions = ""
|
conditions = ""
|
||||||
for field in ["customer", "territory", "supplier", "supplier_type",
|
for field in ["customer", "supplier", "supplier_type", "campaign", "sales_partner"]:
|
||||||
"campaign", "sales_partner"]:
|
|
||||||
if args_dict.get(field):
|
if args_dict.get(field):
|
||||||
conditions += " and ifnull("+field+", '') in (%("+field+")s, '')"
|
conditions += " and ifnull("+field+", '') in (%("+field+")s, '')"
|
||||||
else:
|
else:
|
||||||
conditions += " and ifnull("+field+", '') = ''"
|
conditions += " and ifnull("+field+", '') = ''"
|
||||||
|
|
||||||
customer_group_condition = _get_tree_conditions("Customer Group")
|
for doctype in ["Customer Group", "Territory"]:
|
||||||
if customer_group_condition:
|
group_condition = _get_tree_conditions(doctype)
|
||||||
conditions += " and " + customer_group_condition
|
if group_condition:
|
||||||
|
conditions += " and " + group_condition
|
||||||
|
|
||||||
conditions += " and ifnull(for_price_list, '') in (%(price_list)s, '')"
|
conditions += " and ifnull(for_price_list, '') in (%(price_list)s, '')"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user