From d3582ea399bb77d21bc1a2e1d902a3b3035628b6 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 25 Apr 2022 18:18:39 +0530 Subject: [PATCH] fix: Allow multi-currency opening invoices --- .../opening_invoice_creation_tool.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py index 9d4d76b8f6..174b7d7f46 100644 --- a/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py +++ b/erpnext/accounts/doctype/opening_invoice_creation_tool/opening_invoice_creation_tool.py @@ -154,6 +154,7 @@ class OpeningInvoiceCreationTool(Document): "income_account" if row.party_type == "Customer" else "expense_account" ) default_uom = frappe.db.get_single_value("Stock Settings", "stock_uom") or _("Nos") + default_currency = frappe.db.get_value(row.party_type, row.party, "default_currency") rate = flt(row.outstanding_amount) / flt(row.qty) item_dict = frappe._dict( @@ -166,6 +167,7 @@ class OpeningInvoiceCreationTool(Document): "description": row.item_name or "Opening Invoice Item", income_expense_account_field: row.temporary_opening_account, "cost_center": cost_center, + "currency": default_currency, } )