From ab36b27a94f5f88a71358292ef7b76103c7080b7 Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Wed, 9 Feb 2022 10:10:17 +0530 Subject: [PATCH] fix: ignore pricing rule in all transactions --- erpnext/controllers/accounts_controller.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index d86b6c7ea4..994b903b32 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -407,11 +407,19 @@ class AccountsController(TransactionBase): if item_qty != len(get_serial_nos(item.get('serial_no'))): item.set(fieldname, value) - elif ret.get("pricing_rule_removed") and value is not None \ - and fieldname in [ - 'discount_percentage', 'discount_amount', 'rate', - 'margin_rate_or_amount', 'margin_type', 'remove_free_item' - ]: + elif ( + ret.get("pricing_rule_removed") + and value is not None + and fieldname + in [ + "discount_percentage", + "discount_amount", + "rate", + "margin_rate_or_amount", + "margin_type", + "remove_free_item", + ] + ): # reset pricing rule fields if pricing_rule_removed item.set(fieldname, value)