Merge branch 'version-13-hotfix' into mergify/bp/version-13-hotfix/pr-29701

This commit is contained in:
Saqib Ansari
2022-02-10 10:53:53 +05:30
committed by GitHub
7 changed files with 109 additions and 26 deletions

View File

@@ -408,6 +408,22 @@ 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",
]
):
# reset pricing rule fields if pricing_rule_removed
item.set(fieldname, value)
if self.doctype in ["Purchase Invoice", "Sales Invoice"] and item.meta.get_field('is_fixed_asset'):
item.set('is_fixed_asset', ret.get('is_fixed_asset', 0))