mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-26 06:31:13 +01:00
fix: skip last purchase rate for free item (#47693)
(cherry picked from commit c3b17024bd)
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -20,6 +20,9 @@ def update_last_purchase_rate(doc, is_submit) -> None:
|
|||||||
this_purchase_date = getdate(doc.get("posting_date") or doc.get("transaction_date"))
|
this_purchase_date = getdate(doc.get("posting_date") or doc.get("transaction_date"))
|
||||||
|
|
||||||
for d in doc.get("items"):
|
for d in doc.get("items"):
|
||||||
|
if d.get("is_free_item"):
|
||||||
|
continue
|
||||||
|
|
||||||
# get last purchase details
|
# get last purchase details
|
||||||
last_purchase_details = get_last_purchase_details(d.item_code, doc.name)
|
last_purchase_details = get_last_purchase_details(d.item_code, doc.name)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user