fix: ignore pricing rule in all transactions

This commit is contained in:
Saqib Ansari 2022-02-09 10:10:17 +05:30
parent 6fa406dd04
commit ab36b27a94

View File

@ -407,11 +407,19 @@ class AccountsController(TransactionBase):
if item_qty != len(get_serial_nos(item.get('serial_no'))): if item_qty != len(get_serial_nos(item.get('serial_no'))):
item.set(fieldname, value) item.set(fieldname, value)
elif ret.get("pricing_rule_removed") and value is not None \ elif (
and fieldname in [ ret.get("pricing_rule_removed")
'discount_percentage', 'discount_amount', 'rate', and value is not None
'margin_rate_or_amount', 'margin_type', 'remove_free_item' 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 # reset pricing rule fields if pricing_rule_removed
item.set(fieldname, value) item.set(fieldname, value)