From 87e2bb4f15e7104fd520b04beb90b7e38644bc2d Mon Sep 17 00:00:00 2001 From: "Maximilien (malb)" Date: Tue, 14 Mar 2023 09:20:51 +0000 Subject: [PATCH] [FIX] l10n_de: miss configured account By checking the script checking if all the account supposed to be in the BS are. The account 1380 of skr03 and the account 9090 of skr04 seems to be miss configured. For the first account, we went back to task 31826 when the account was added. And we think that the account 1380 was indeed misconfigured. For the other, by comparing with skr03 which has the same account, we can see that the type of the account is wrong. Also, the balance sheet works with tags. Some accounts added after the load of the chart template were missing some tags. By overriding those methods, we can add tags afterward and be sure that those account are present in the Balance sheet. closes odoo/odoo#117881 Task-id: 3041738 X-original-commit: 44e8295b2df5db73efa7a85003332c092fbfca7b Signed-off-by: Brice Bartoletti (bib) Signed-off-by: Maximilien La Barre (malb) --- addons/l10n_de/models/chart_template.py | 11 +++++++++-- .../data/template/account.account-de_skr03.csv | 2 +- .../data/template/account.account-de_skr04.csv | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/addons/l10n_de/models/chart_template.py b/addons/l10n_de/models/chart_template.py index 91e34bec986..3d797f830fb 100644 --- a/addons/l10n_de/models/chart_template.py +++ b/addons/l10n_de/models/chart_template.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- -from odoo import models from odoo.addons.account.models.chart_template import template - +from odoo import models class AccountChartTemplate(models.AbstractModel): _inherit = 'account.chart.template' @@ -15,3 +14,11 @@ class AccountChartTemplate(models.AbstractModel): 'paperformat_id': 'l10n_din5008.paperformat_euro_din', } } + + def _setup_utility_bank_accounts(self, template_code, company, template_data): + super()._setup_utility_bank_accounts(template_code, company, template_data) + if template_code in ["de_skr03", "de_skr04"]: + company.account_journal_suspense_account_id.tag_ids = self.env.ref('l10n_de.tag_de_asset_bs_B_II_4') + company.account_journal_payment_debit_account_id.tag_ids = self.env.ref('l10n_de.tag_de_asset_bs_B_II_4') + company.account_journal_payment_credit_account_id.tag_ids = self.env.ref('l10n_de.tag_de_asset_bs_B_II_4') + company.transfer_account_id.tag_ids = self.env.ref('l10n_de.tag_de_asset_bs_B_IV') diff --git a/addons/l10n_de_skr03/data/template/account.account-de_skr03.csv b/addons/l10n_de_skr03/data/template/account.account-de_skr03.csv index 5520fb31799..6d4ec4ad3a4 100644 --- a/addons/l10n_de_skr03/data/template/account.account-de_skr03.csv +++ b/addons/l10n_de_skr03/data/template/account.account-de_skr03.csv @@ -281,7 +281,7 @@ "account_1376","1376","Receivables from typical silent partners","l10n_de.tag_de_asset_bs_B_II_4","asset_current","False","","Forderungen gegen typisch stille Gesellschafter" "account_1377","1377","Receivables from typical silent partners - remaining term up to 1 year","l10n_de.tag_de_asset_bs_B_II_4","asset_current","False","","Forderungen gegen typisch stille Gesellschafter - Restlaufzeit bis 1 Jahr" "account_1378","1378","Receivables from typical silent partners - remaining term greater than 1 year","l10n_de.tag_de_asset_bs_B_II_4","asset_non_current","False","","Forderungen gegen typisch stille Gesellschafter - Restlaufzeit größer 1 Jahr" -"account_1380","1380","Cost centre reconciliation account","l10n_de.tag_de_pl_06","asset_current","False","","Überleitungskonto Kostenstelle" +"account_1380","1380","Cost centre reconciliation account","l10n_de.tag_de_asset_bs_B_II_4","asset_current","False","","Überleitungskonto Kostenstelle" "account_1381","1381","Receivables from GmbH shareholders","l10n_de.tag_de_asset_bs_B_II_4","asset_current","False","","Forderungen gegen GmbH-Gesellschafter" "account_1382","1382","Receivables from GmbH shareholders - remaining term up to 1 year","l10n_de.tag_de_asset_bs_B_II_4","asset_current","False","","Forderungen gegen GmbH-Gesellschafter - Restlaufzeit bis 1 Jahr" "account_1383","1383","Receivables from GmbH shareholders - remaining term greater than 1 year","l10n_de.tag_de_asset_bs_B_II_4","asset_non_current","False","","Forderungen gegen GmbH-Gesellschafter - Restlaufzeit größer 1 Jahr" diff --git a/addons/l10n_de_skr04/data/template/account.account-de_skr04.csv b/addons/l10n_de_skr04/data/template/account.account-de_skr04.csv index 881743dd5dc..87519ab5715 100644 --- a/addons/l10n_de_skr04/data/template/account.account-de_skr04.csv +++ b/addons/l10n_de_skr04/data/template/account.account-de_skr04.csv @@ -1198,6 +1198,6 @@ "chart_skr04_9000","9000","Balances brought forward","","income_other","","","Saldenvorträge, Sachkonten" "chart_skr04_9008","9008","Balances brought forward, receivables","","income_other","","","Saldenvorträge, Debitoren" "chart_skr04_9009","9009","Balances brought forward, payables","","income_other","","","Saldenvorträge, Kreditoren" -"chart_skr04_9090","9090","Aggregate carryforwards account","","asset_current","","","Summenvortragskonto" +"chart_skr04_9090","9090","Aggregate carryforwards account","","income_other","","","Summenvortragskonto" "chart_skr04_9991","9991","Cash Difference Gain","account.account_tag_operating,l10n_de.tag_de_pl_04","income","","","" "chart_skr04_9994","9994","Cash Difference Loss","account.account_tag_operating,l10n_de.tag_de_pl_08_7","expense","","",""