From 078eb46eb80d2c367828fbe69b25a21d40896a31 Mon Sep 17 00:00:00 2001 From: Smit Vora Date: Mon, 7 Oct 2024 22:55:58 +0530 Subject: [PATCH] fix: get company from ref doc as it's not available in payment request --- erpnext/accounts/doctype/payment_request/payment_request.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index dc21f0b88a2..f24b2891723 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -101,9 +101,10 @@ class PaymentRequest(Document): ) def before_submit(self): + company = frappe.get_value(self.reference_doctype, self.reference_name, "company") if ( self.currency != self.party_account_currency - and self.party_account_currency == get_company_currency(self.company) + and self.party_account_currency == get_company_currency(company) ): # set outstanding amount in party account currency invoice = frappe.get_value(