From aa0b93d0b29ed9722129fd372d695b0b7d2e02e7 Mon Sep 17 00:00:00 2001 From: venkat102 Date: Thu, 10 Apr 2025 16:07:20 +0530 Subject: [PATCH] fix: fetch exchange rate while creating inter-company order and invoice (cherry picked from commit 145a6c5e2a2a721f880978c94bffe5ae5b59ef2a) --- erpnext/public/js/controllers/transaction.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 9c6ae5afa98..59dd337d3af 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1127,13 +1127,14 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe currency() { // The transaction date be either transaction_date (from orders) or posting_date (from invoices) let transaction_date = this.frm.doc.transaction_date || this.frm.doc.posting_date; + let inter_company_reference = this.frm.doc.inter_company_order_reference || this.frm.doc.inter_company_invoice_reference; let me = this; this.set_dynamic_labels(); let company_currency = this.get_company_currency(); // Added `load_after_mapping` to determine if document is loading after mapping from another doc if(this.frm.doc.currency && this.frm.doc.currency !== company_currency - && !this.frm.doc.__onload?.load_after_mapping) { + && (!this.frm.doc.__onload?.load_after_mapping || inter_company_reference)) { this.get_exchange_rate(transaction_date, this.frm.doc.currency, company_currency, function(exchange_rate) {