From b176dea74ef231ca27b455cc0e98913e55bed0e8 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Mon, 28 Mar 2016 13:23:47 +0530 Subject: [PATCH] Fixed issues in Pricing Rule if multiple pricing rules existed with same priority --- erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index cd6bcf450b..736d03c800 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -242,6 +242,8 @@ def filter_pricing_rules(args, pricing_rules): for p in pricing_rules: if p.item_code and args.variant_of: p.variant_of = args.variant_of + else: + p.variant_of = None # find pricing rule with highest priority if pricing_rules: @@ -251,7 +253,7 @@ def filter_pricing_rules(args, pricing_rules): # apply internal priority all_fields = ["item_code", "item_group", "brand", "customer", "customer_group", "territory", - "supplier", "supplier_type", "campaign", "sales_partner"] + "supplier", "supplier_type", "campaign", "sales_partner", "variant_of"] if len(pricing_rules) > 1: for field_set in [["item_code", "variant_of", "item_group", "brand"],