refactor: optional company param to create_payment_gateway_account

This commit is contained in:
muruthigitau
2025-03-27 11:09:02 +03:00
committed by ruthra kumar
parent b4be1503e3
commit 6608735006

View File

@@ -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(