Skip to content

Commit

Permalink
fix: add is_new in if condition
Browse files Browse the repository at this point in the history
(cherry picked from commit 4dcac56)
  • Loading branch information
mihir-kandoi authored and mergify[bot] committed Feb 19, 2025
1 parent 116798d commit ef37388
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion erpnext/accounts/doctype/pricing_rule/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,9 @@ def apply_pricing_rule_for_free_items(doc, pricing_rule_args):
args.pop((item.item_code, item.pricing_rules))

for free_item in args.values():
if frappe.get_value("Pricing Rule", free_item["pricing_rules"], "enforce_free_item_qty"):
if doc.is_new() or frappe.get_value(
"Pricing Rule", free_item["pricing_rules"], "enforce_free_item_qty"
):
doc.append("items", free_item)


Expand Down

0 comments on commit ef37388

Please sign in to comment.