From 493c8ce04e672972e261f60895a0a5ba4b7c6be8 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 28 Jul 2025 14:56:17 +0530 Subject: [PATCH 1/2] fix: incorrect GL entries (cherry picked from commit 4c273fcc99f5601abbe854ed903abc479e2642c2) # Conflicts: # erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py --- erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index b3b18b088ad..8b13dfc11ce 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -781,8 +781,12 @@ class PurchaseInvoice(BuyingController): self.get_provisional_accounts() for item in self.get("items"): +<<<<<<< HEAD if flt(item.base_net_amount): account_currency = get_account_currency(item.expense_account) +======= + if flt(item.base_net_amount) or (self.get("update_stock") and item.valuation_rate): +>>>>>>> 4c273fcc99 (fix: incorrect GL entries) if item.item_code: frappe.get_cached_value("Item", item.item_code, "asset_category") From a944eaf0544200a514222b2281cc56e8a8d28d53 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 28 Jul 2025 16:35:39 +0530 Subject: [PATCH 2/2] chore: fix conflicts --- .../accounts/doctype/purchase_invoice/purchase_invoice.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 8b13dfc11ce..b0de69ed5cd 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -781,12 +781,8 @@ class PurchaseInvoice(BuyingController): self.get_provisional_accounts() for item in self.get("items"): -<<<<<<< HEAD - if flt(item.base_net_amount): - account_currency = get_account_currency(item.expense_account) -======= if flt(item.base_net_amount) or (self.get("update_stock") and item.valuation_rate): ->>>>>>> 4c273fcc99 (fix: incorrect GL entries) + account_currency = get_account_currency(item.expense_account) if item.item_code: frappe.get_cached_value("Item", item.item_code, "asset_category")