From 614f5adf6d8fd080131ef47a1692827a616156fa Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 1 Apr 2019 10:53:08 +0530 Subject: [PATCH] fix: code cleanup --- erpnext/accounts/doctype/pricing_rule/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/pricing_rule/utils.py b/erpnext/accounts/doctype/pricing_rule/utils.py index 936f97cba9..d3db130f3a 100644 --- a/erpnext/accounts/doctype/pricing_rule/utils.py +++ b/erpnext/accounts/doctype/pricing_rule/utils.py @@ -497,8 +497,8 @@ def apply_pricing_rule(doc, pr_doc, item_row, value, do_not_validate=False): frappe.msgprint(_("Row {0}: user has not applied rule {1} on the item {2}") .format(item.idx, pr_doc.title, item.item_code)) - if rule_applied and doc.pricing_rules: - for d in doc.pricing_rules: + if rule_applied and doc.get("pricing_rules"): + for d in doc.get("pricing_rules"): key = (d.child_docname, d.pricing_rule) if key in rule_applied: d.rule_applied = 1