From f3aa8854880173dd89a911ca4198c9fc605e35f1 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 (cherry picked from commit 5e875b238c9d1a1c376f2fa98c0d2451da7e80b7) --- 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 60c9e26aabe..9c7911d7cae 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