From ac8f4b449d1e56b6c3170b1969b37404199107fd Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 30 May 2019 22:24:24 +0530 Subject: [PATCH] fix: pricing rule not exists issue --- erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index 01b935c999..9a95e087c1 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -321,7 +321,7 @@ def set_discount_amount(rate, item_details): def remove_pricing_rule_for_item(pricing_rules, item_details, item_code=None): from erpnext.accounts.doctype.pricing_rule.utils import get_apply_on_and_items for d in pricing_rules.split(','): - if not d: continue + if not d or not frappe.db.exists("Pricing Rule", d): continue pricing_rule = frappe.get_doc('Pricing Rule', d) if pricing_rule.price_or_product_discount == 'Price':