From 682620cddccd5462c62985398bc7ccf22efd10d4 Mon Sep 17 00:00:00 2001 From: "Daniel Kosky (dako)" Date: Mon, 9 Jan 2023 09:17:19 +0000 Subject: [PATCH] [IMP] l10n_fr_reports: Round lines of tax report and closing entries to the nearest euro French tax reports require that each line is rounded to the nearest euro. This requires that a line is added to the closing entries to account for the differences from rounding. The line requires a couple of default accounts for the profit/loss from rounding to be applied. These accounts for profit/loss are by default 758000/658000 and are inherited in the chart of accounts for l10n_fr (you will only need them if you're doing french tax reports). The fields are also added to res_company for l10n_fr, non french companies can still file french tax reports, so if they are filing french tax reports without these accounts then they'll need to specify them in settings This commit also adapts the subformula of the carryover line on the tax report to round the final value, this means that a rounded value will persist between periods. task-2610752 closes odoo/odoo#75634 Related: odoo/enterprise#20245 Signed-off-by: Josse Colpaert --- addons/l10n_fr/data/tax_report_data.xml | 1 + addons/l10n_fr/models/res_company.py | 3 +++ addons/l10n_fr/models/template_fr.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/addons/l10n_fr/data/tax_report_data.xml b/addons/l10n_fr/data/tax_report_data.xml index f13dd5bf8a3..630e4b169a1 100644 --- a/addons/l10n_fr/data/tax_report_data.xml +++ b/addons/l10n_fr/data/tax_report_data.xml @@ -890,6 +890,7 @@ aggregation box_27.balance box_22._applied_carryover_balance + round(0) diff --git a/addons/l10n_fr/models/res_company.py b/addons/l10n_fr/models/res_company.py index b0afe7abad6..ceb530d7ad4 100644 --- a/addons/l10n_fr/models/res_company.py +++ b/addons/l10n_fr/models/res_company.py @@ -11,6 +11,9 @@ class ResCompany(models.Model): siret = fields.Char(related='partner_id.siret', string='SIRET', size=14, readonly=False) ape = fields.Char(string='APE') + l10n_fr_rounding_difference_loss_account_id = fields.Many2one('account.account') + l10n_fr_rounding_difference_profit_account_id = fields.Many2one('account.account') + @api.model def _get_unalterable_country(self): return ['FR', 'MF', 'MQ', 'NC', 'PF', 'RE', 'GF', 'GP', 'TF'] # These codes correspond to France and DOM-TOM. diff --git a/addons/l10n_fr/models/template_fr.py b/addons/l10n_fr/models/template_fr.py index 14e0be10d97..102f0f4a5e3 100644 --- a/addons/l10n_fr/models/template_fr.py +++ b/addons/l10n_fr/models/template_fr.py @@ -29,6 +29,8 @@ class AccountChartTemplate(models.AbstractModel): 'expense_currency_exchange_account_id': 'pcg_666', 'account_journal_early_pay_discount_loss_account_id': 'pcg_665', 'account_journal_early_pay_discount_gain_account_id': 'pcg_765', + 'l10n_fr_rounding_difference_loss_account_id': 'pcg_658', + 'l10n_fr_rounding_difference_profit_account_id': 'pcg_758', }, }