fix: last purchase rate not updated from purchase invoice (#42847)

This commit is contained in:
rohitwaghchaure
2024-08-21 14:52:24 +05:30
committed by GitHub
parent 9c82c2b5d3
commit 5b9309cf34

View File

@@ -689,9 +689,11 @@ class BuyingController(SubcontractingController):
if self.doctype in ["Purchase Receipt", "Purchase Invoice"]: if self.doctype in ["Purchase Receipt", "Purchase Invoice"]:
self.process_fixed_asset() self.process_fixed_asset()
if self.doctype in ["Purchase Order", "Purchase Receipt"] and not frappe.db.get_single_value( if self.doctype in [
"Buying Settings", "disable_last_purchase_rate" "Purchase Order",
): "Purchase Receipt",
"Purchase Invoice",
] and not frappe.db.get_single_value("Buying Settings", "disable_last_purchase_rate"):
update_last_purchase_rate(self, is_submit=1) update_last_purchase_rate(self, is_submit=1)
def on_cancel(self): def on_cancel(self):