From 6608735006176fcabc21e7e97f36ddcf91d6f0a9 Mon Sep 17 00:00:00 2001 From: muruthigitau Date: Thu, 27 Mar 2025 11:09:02 +0300 Subject: [PATCH] refactor: optional company param to create_payment_gateway_account --- erpnext/accounts/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index ab2578fdbb0..f117adb1f8f 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -1281,12 +1281,13 @@ def get_account_balances(accounts, company): return accounts -def create_payment_gateway_account(gateway, payment_channel="Email"): +def create_payment_gateway_account(gateway, payment_channel="Email", company=None): from erpnext.setup.setup_wizard.operations.install_fixtures import create_bank_account - company = frappe.get_cached_value("Global Defaults", "Global Defaults", "default_company") if not company: - return + company = frappe.get_cached_value("Global Defaults", "Global Defaults", "default_company") + if not company: + return # NOTE: we translate Payment Gateway account name because that is going to be used by the end user bank_account = frappe.db.get_value(