From 38c2e67d382a15b27acdb55d73310601e6c84ab9 Mon Sep 17 00:00:00 2001 From: Casey Date: Mon, 9 Feb 2026 14:02:59 -0600 Subject: [PATCH] update install py --- custom_ui/install.py | 50 +++++++++++++------------------------------- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/custom_ui/install.py b/custom_ui/install.py index 4285ae1..8c0b3d5 100644 --- a/custom_ui/install.py +++ b/custom_ui/install.py @@ -863,12 +863,6 @@ def create_companies(): 'parent_company': None, 'create_chart_of_accounts_based_on': 'Standard Template', 'chart_of_accounts': 'Standard', - 'default_cash_account': 'Cash - VS', - 'default_receivable_account': 'Debtors - VS', - 'default_payable_account': 'Creditors - VS', - 'default_income_account': 'Sales - VS', - 'default_expense_account': 'Cost of Goods Sold - VS', - 'cost_center': 'Main - VS', 'enable_perpetual_inventory': 1 }, { @@ -880,12 +874,6 @@ def create_companies(): 'parent_company': None, 'create_chart_of_accounts_based_on': 'Standard Template', 'chart_of_accounts': 'Standard', - 'default_cash_account': 'Cash - DL', - 'default_receivable_account': 'Debtors - DL', - 'default_payable_account': 'Creditors - DL', - 'default_income_account': 'Sales - DL', - 'default_expense_account': 'Cost of Goods Sold - DL', - 'cost_center': 'Main - DL', 'enable_perpetual_inventory': 1 }, { @@ -897,12 +885,6 @@ def create_companies(): 'parent_company': None, 'create_chart_of_accounts_based_on': 'Standard Template', 'chart_of_accounts': 'Standard', - 'default_cash_account': 'Cash - SD', - 'default_receivable_account': 'Debtors - SD', - 'default_payable_account': 'Creditors - SD', - 'default_income_account': 'Sales - SD', - 'default_expense_account': 'Cost of Goods Sold - SD', - 'cost_center': 'Main - SD', 'enable_perpetual_inventory': 1 }, { @@ -914,12 +896,6 @@ def create_companies(): 'parent_company': None, 'create_chart_of_accounts_based_on': 'Standard Template', 'chart_of_accounts': 'Standard', - 'default_cash_account': 'Cash - LF', - 'default_receivable_account': 'Debtors - LF', - 'default_payable_account': 'Creditors - LF', - 'default_income_account': 'Fencing Sales - LF', - 'default_expense_account': 'Cost of Goods Sold - LF', - 'cost_center': 'Main - LF', 'enable_perpetual_inventory': 1 }, { @@ -931,12 +907,6 @@ def create_companies(): 'parent_company': None, 'create_chart_of_accounts_based_on': 'Standard Template', 'chart_of_accounts': 'Standard', - 'default_cash_account': 'Cash - NYC', - 'default_receivable_account': 'Debtors - NYC', - 'default_payable_account': 'Creditors - NYC', - 'default_income_account': 'Sales - NYC', - 'default_expense_account': 'Cost of Goods Sold - NYC', - 'cost_center': 'Main - NYC', 'enable_perpetual_inventory': 1 }, { @@ -948,12 +918,6 @@ def create_companies(): 'parent_company': None, 'create_chart_of_accounts_based_on': 'Standard Template', 'chart_of_accounts': 'Standard', - 'default_cash_account': 'Undeposited Funds - S', - 'default_receivable_account': 'Debtors - S', - 'default_payable_account': 'Creditors - S', - 'default_income_account': 'Sales - S', - 'default_expense_account': 'Cost of Goods Sold - S', - 'cost_center': 'Main - S', 'enable_perpetual_inventory': 1 } ] @@ -966,6 +930,20 @@ def create_companies(): data.update(company) doc = frappe.get_doc(data) doc.insert(ignore_permissions=True) + set_default_accounts(doc) + +def set_default_accounts(company_doc): + """Set default accounts for a company after creation.""" + abbr = company_doc.abbr + company_doc.default_cash_account = f"Cash - {abbr}" + company_doc.default_receivable_account = f"Debtors - {abbr}" + company_doc.default_payable_account = f"Creditors - {abbr}" + company_doc.default_income_account = f"Sales - {abbr}" + company_doc.default_expense_account = f"Cost of Goods Sold - {abbr}" + company_doc.cost_center = f"Main - {abbr}" + company_doc.save(ignore_permissions=True) + + def create_accounts():