mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
fix(pricing_rules): rule won't got use across [item_code, item_group, brands]
This commit is contained in:
@@ -30,13 +30,19 @@ apply_on_table = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def get_pricing_rules(args, doc=None):
|
def get_pricing_rules(args, doc=None):
|
||||||
pricing_rules = []
|
pricing_rules_all = []
|
||||||
values = {}
|
values = {}
|
||||||
|
|
||||||
for apply_on in ['Item Code', 'Item Group', 'Brand']:
|
for apply_on in ['Item Code', 'Item Group', 'Brand']:
|
||||||
pricing_rules.extend(_get_pricing_rules(apply_on, args, values))
|
pricing_rules_all.extend(_get_pricing_rules(apply_on, args, values))
|
||||||
if pricing_rules and not apply_multiple_pricing_rules(pricing_rules):
|
|
||||||
break
|
# removing duplicate pricing rule
|
||||||
|
pricing_rules_title = []
|
||||||
|
pricing_rules = []
|
||||||
|
for p in pricing_rules_all:
|
||||||
|
if p['title'] not in pricing_rules_title:
|
||||||
|
pricing_rules_title.append(p['title'])
|
||||||
|
pricing_rules.append(p)
|
||||||
|
|
||||||
rules = []
|
rules = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user