fix: set chart of accounts based on parent company on server side
This commit is contained in:
parent
d787ef8b8e
commit
73acb8c837
@ -39,6 +39,7 @@ class Company(NestedSet):
|
||||
self.validate_coa_input()
|
||||
self.validate_perpetual_inventory()
|
||||
self.check_country_change()
|
||||
self.set_chart_of_accounts()
|
||||
|
||||
def validate_abbr(self):
|
||||
if not self.abbr:
|
||||
@ -174,6 +175,12 @@ class Company(NestedSet):
|
||||
self.country != frappe.get_cached_value('Company', self.name, 'country'):
|
||||
frappe.flags.country_change = True
|
||||
|
||||
def set_chart_of_accounts(self):
|
||||
''' If parent company is set, chart of accounts will be based on that company '''
|
||||
if self.parent_company:
|
||||
self.create_chart_of_accounts_based_on = "Existing Company"
|
||||
self.existing_company = self.parent_company
|
||||
|
||||
def set_default_accounts(self):
|
||||
self._set_default_account("default_cash_account", "Cash")
|
||||
self._set_default_account("default_bank_account", "Bank")
|
||||
|
Loading…
x
Reference in New Issue
Block a user