From 5e875b238c9d1a1c376f2fa98c0d2451da7e80b7 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 21 Jun 2024 15:46:16 +0530 Subject: [PATCH] fix: pricing rule with and without 'apply multiple' and priority Either all of the pricing rules identified for an item should have 'apply multiple' enabled. If not, Priority is applied and only the highest priority is applied --- erpnext/accounts/doctype/pricing_rule/utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py index 9bd417fa5b3..d8f2302d7ef 100644 --- a/erpnext/accounts/doctype/pricing_rule/utils.py +++ b/erpnext/accounts/doctype/pricing_rule/utils.py @@ -174,12 +174,9 @@ def _get_pricing_rules(apply_on, args, values): def apply_multiple_pricing_rules(pricing_rules): - apply_multiple_rule = [ - d.apply_multiple_pricing_rules for d in pricing_rules if d.apply_multiple_pricing_rules - ] - - if not apply_multiple_rule: - return False + for d in pricing_rules: + if not d.apply_multiple_pricing_rules: + return False return True