From c22d4a60c7acfcccfe8b9d62ad4b34c0be1f86e3 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Thu, 18 Jun 2015 10:07:30 +0200 Subject: [PATCH] [IMP] automatized the creation of a 'current year earnings' account when installing a Char of Account --- addons/account/chart_template.py | 8 +++++++- .../l10n_generic_coa/data/configurable_account_chart.xml | 7 ------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/addons/account/chart_template.py b/addons/account/chart_template.py index a5cdd738502..e7c2925971a 100644 --- a/addons/account/chart_template.py +++ b/addons/account/chart_template.py @@ -727,7 +727,6 @@ class WizardMultiChartsAccounts(models.TransientModel): self._create_tax_templates_from_rates(company.id) # Install all the templates objects and generate the real objects - acc_template_ref, taxes_ref = self.chart_template_id._install_template(company, code_digits=self.code_digits, transfer_account_id=self.transfer_account_id) # write values of default taxes for product as super user @@ -738,6 +737,13 @@ class WizardMultiChartsAccounts(models.TransientModel): # Create Bank journals self._create_bank_journals_from_o2m(company, acc_template_ref) + + # Create the current year earning account (outside of the CoA) + self.env['account.account'].create({ + 'code': '0', + 'name': _('Undistributed Profits/Losses'), + 'user_type': self.env.ref("account.data_unaffected_earnings").id, + 'company_id': company.id,}) return {} @api.multi diff --git a/addons/l10n_generic_coa/data/configurable_account_chart.xml b/addons/l10n_generic_coa/data/configurable_account_chart.xml index 16d53d2505d..bce30dc8f46 100644 --- a/addons/l10n_generic_coa/data/configurable_account_chart.xml +++ b/addons/l10n_generic_coa/data/configurable_account_chart.xml @@ -157,13 +157,6 @@ - - 0 - Current Year Earnings - - - - Foreign Exchange Gain 2010