fix: last purchase rate for purchase invoice

This commit is contained in:
Rohit Waghchaure
2024-09-30 18:28:12 +05:30
parent 1abcb29cef
commit fb9d106633
4 changed files with 71 additions and 30 deletions

View File

@@ -702,9 +702,11 @@ class BuyingController(SubcontractingController):
if self.get("is_return"):
return
if self.doctype in ["Purchase Order", "Purchase Receipt"] and not frappe.db.get_single_value(
"Buying Settings", "disable_last_purchase_rate"
):
if self.doctype in [
"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=0)
if self.doctype in ["Purchase Receipt", "Purchase Invoice"]: