summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqdp-odoo <qdp@odoo.com>2015-06-18 10:07:30 +0200
committerqdp-odoo <qdp@odoo.com>2015-06-18 10:07:30 +0200
commitc22d4a60c7acfcccfe8b9d62ad4b34c0be1f86e3 (patch)
tree39433d4ec0a662afc5f66e513c30feffc4fa1260
parent7cbe33efdfaafd992f903f34487526265db6ce39 (diff)
[IMP] automatized the creation of a 'current year earnings' account when installing a Char of Account
-rw-r--r--addons/account/chart_template.py8
-rw-r--r--addons/l10n_generic_coa/data/configurable_account_chart.xml7
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 @@
<field name="tag_ids" eval="[(6,0,[ref('account.account_tag_operating')])]"/>
</record>
- <record id="conf_a_current_year_earnings" model="account.account.template">
- <field name="code">0</field>
- <field name="name">Current Year Earnings</field>
- <field name="user_type" ref="account.data_unaffected_earnings"/>
- <field name="chart_template_id" ref="configurable_chart_template"/>
- </record>
-
<record model="account.account.template" id="exchange_fx_income">
<field name="name">Foreign Exchange Gain</field>
<field name="code">2010</field>