summaryrefslogtreecommitdiff
path: root/addons/l10n_generic_coa
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2020-06-11 09:02:46 +0000
committerDenis Ledoux <dle@odoo.com>2020-06-11 15:13:19 +0000
commit0f966196fb5e9de26d437f3435325c45cd9e8d7c (patch)
tree8033c38d47ec0da16a9db7aa73cc2e63d676c9d7 /addons/l10n_generic_coa
parenta6c43e0366473f9e920a35d95f1703ba58a20fef (diff)
[FIX] l10n_*: no chart template should be set to noupdate
In a general manner, the chart templates should not be set to noupdate, that way, if a new company starts in an existing database, it starts with an up-to-date chart of accounts. For instance, if the chart of template is not updated from 12.0 to 13.0, the `default_pos_receivable_account_id` is not added in the chart template, and when a new company is created, the default pos receivable account is not set on the company. Besides, the field `res.company``account_default_pos_receivable_account_id` is not displayed on any form view, whether or not the full accounting is installed, so we must especially pay attention this default account is well set from start, as the user as no opportunity to correct this by himself. In addition, in upgrade scripts, the default pos receivable account on the chart template is used to correctly set the pos receivable account on the company and on the pos payment methods, so it must be well set for the upgrade script to do its job correctly. Technically, it means, without this revision, the fields: - `account.chart.template``default_pos_receivable_account_id`, - `res.company``account_default_pos_receivable_account_id`, - `pos.payment.method``receivable_account_id` were not filled properly on upgrade, causing critical issues in the accounting entries on pos session closing. Related to #52786 Related to odoo/upgrade@ccfd2371ef89ae67dc9bd68bb0d02f2a440551a2 closes odoo/odoo#52870 X-original-commit: 3258ba015ff75b7c176d83a44261d24ebfcc26de Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Diffstat (limited to 'addons/l10n_generic_coa')
-rw-r--r--addons/l10n_generic_coa/data/l10n_generic_coa.xml2
-rw-r--r--addons/l10n_generic_coa/data/l10n_generic_coa_post.xml15
2 files changed, 10 insertions, 7 deletions
diff --git a/addons/l10n_generic_coa/data/l10n_generic_coa.xml b/addons/l10n_generic_coa/data/l10n_generic_coa.xml
index 288d30423a5..b729c78cd9d 100644
--- a/addons/l10n_generic_coa/data/l10n_generic_coa.xml
+++ b/addons/l10n_generic_coa/data/l10n_generic_coa.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<odoo noupdate="1">
+<odoo>
<!-- Account Tax Group -->
<record id="configurable_chart_template" model="account.chart.template">
<field name="name">Configurable Account Chart Template</field>
diff --git a/addons/l10n_generic_coa/data/l10n_generic_coa_post.xml b/addons/l10n_generic_coa/data/l10n_generic_coa_post.xml
index 9b6217f1037..d06ccea8560 100644
--- a/addons/l10n_generic_coa/data/l10n_generic_coa_post.xml
+++ b/addons/l10n_generic_coa/data/l10n_generic_coa_post.xml
@@ -1,5 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
-<odoo noupdate="1">
+<odoo>
+<data noupdate="1">
+ <!-- Tax template for sale and purchase -->
+ <record id="tax_group_15" model="account.tax.group">
+ <field name="name">Tax 15%</field>
+ </record>
+</data>
+<data>
<!-- Chart template account links -->
<record id="configurable_chart_template" model="account.chart.template">
<field name="complete_tax_set" eval="False"/>
@@ -23,11 +30,6 @@
<field name="default_pos_receivable_account_id" ref="pos_receivable"/>
</record>
- <!-- Tax template for sale and purchase -->
- <record id="tax_group_15" model="account.tax.group">
- <field name="name">Tax 15%</field>
- </record>
-
<record id="sale_tax_template" model="account.tax.template">
<field name="chart_template_id" ref="configurable_chart_template"/>
<field name="name">Tax 15%</field>
@@ -92,4 +94,5 @@
<function model="account.chart.template" name="try_loading">
<value eval="[ref('l10n_generic_coa.configurable_chart_template')]"/>
</function>
+</data>
</odoo>