From 0513481ec8bcc86ba0f11818f0e1591b12b38553 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Tue, 30 Apr 2024 13:28:43 +0530 Subject: [PATCH] fix: Purchase Invoice gain loss gl entry for periodic inventory (cherry picked from commit 24024475681e93d58697a1c6d740f70ebaf88f7b) --- erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index dbc9ab474d2..272a180ca8d 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -1091,7 +1091,7 @@ class PurchaseInvoice(BuyingController): ) # check if the exchange rate has changed - if item.get("purchase_receipt"): + if item.get("purchase_receipt") and self.auto_accounting_for_stock: if ( exchange_rate_map[item.purchase_receipt] and self.conversion_rate != exchange_rate_map[item.purchase_receipt]