From a0cfe449df1e2e3cb07f41ef7ad4b1bce1170c49 Mon Sep 17 00:00:00 2001 From: Devin Slauenwhite Date: Tue, 23 Mar 2021 16:28:54 -0400 Subject: [PATCH] fix sider errors. --- erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index 60c7c652c15..25d2d6c6cee 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -331,12 +331,13 @@ def apply_price_discount_rule(pricing_rule, item_details, args): item_details.pricing_rule_for = pricing_rule.rate_or_discount for apply_on in ['Percentage', 'Amount']: - if pricing_rule.margin_type != apply_on: continue + if pricing_rule.margin_type != apply_on: + continue field = 'margin_rate_or_amount' if field not in item_details: - item_details.setdefault(field, 0) - item_details.setdefault('margin_type', apply_on) + item_details.setdefault(field, 0) + item_details.setdefault('margin_type', apply_on) item_details[field] += (pricing_rule.get(field, 0) if pricing_rule else args.get(field, 0))