mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
perf: skip get_pricing_rules if no pricing rule exists
This commit is contained in:
@@ -29,6 +29,9 @@ def get_pricing_rules(args, doc=None):
|
|||||||
pricing_rules = []
|
pricing_rules = []
|
||||||
values = {}
|
values = {}
|
||||||
|
|
||||||
|
if not frappe.db.exists('Pricing Rule', {'disable': 0, args.transaction_type: 1}):
|
||||||
|
return
|
||||||
|
|
||||||
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.extend(_get_pricing_rules(apply_on, args, values))
|
||||||
if pricing_rules and not apply_multiple_pricing_rules(pricing_rules):
|
if pricing_rules and not apply_multiple_pricing_rules(pricing_rules):
|
||||||
|
|||||||
Reference in New Issue
Block a user