Skip to content

Commit 895aec5

Browse files
committed
Merge PR #5533 into 17.0
Signed-off-by hbrunn
2 parents d318996 + 1862615 commit 895aec5

4 files changed

Lines changed: 1069 additions & 5 deletions

File tree

docsource/modules160-170.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,19 +364,19 @@ Module coverage 16.0 -> 17.0
364364
+---------------------------------------------------+----------------------+-------------------------------------------------+
365365
| l10n_fi_sale | | |
366366
+---------------------------------------------------+----------------------+-------------------------------------------------+
367-
| l10n_fr | | |
367+
| l10n_fr | Done | |
368368
+---------------------------------------------------+----------------------+-------------------------------------------------+
369-
| l10n_fr_facturx_chorus_pro | |No DB layout changes. |
369+
| l10n_fr_facturx_chorus_pro | Nothing to do |No DB layout changes. |
370370
+---------------------------------------------------+----------------------+-------------------------------------------------+
371-
| l10n_fr_fec | |No DB layout changes. |
371+
| l10n_fr_fec | Nothing to do |No DB layout changes. |
372372
+---------------------------------------------------+----------------------+-------------------------------------------------+
373373
| |new| l10n_fr_hr_holidays | | |
374374
+---------------------------------------------------+----------------------+-------------------------------------------------+
375375
| |new| l10n_fr_hr_work_entry_holidays | | |
376376
+---------------------------------------------------+----------------------+-------------------------------------------------+
377-
| l10n_fr_invoice_addr | |No DB layout changes. |
377+
| l10n_fr_invoice_addr | Nothing to do |No DB layout changes. |
378378
+---------------------------------------------------+----------------------+-------------------------------------------------+
379-
| l10n_fr_pos_cert | |No DB layout changes. |
379+
| l10n_fr_pos_cert | Nothing to do |No DB layout changes. |
380380
+---------------------------------------------------+----------------------+-------------------------------------------------+
381381
| |new| l10n_ga | | |
382382
+---------------------------------------------------+----------------------+-------------------------------------------------+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright 2026 Le Filament
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from openupgradelib import openupgrade
4+
5+
6+
def _assign_default_rounding_account(env):
7+
fr_company_ids = (
8+
env["res.company"]
9+
.search([])
10+
.filtered(lambda c: c.country_code in c._get_france_country_codes())
11+
)
12+
for company in fr_company_ids:
13+
company.l10n_fr_rounding_difference_loss_account_id = env.ref(
14+
f"account.{company.id}_pcg_4768", False
15+
)
16+
company.l10n_fr_rounding_difference_profit_account_id = env.ref(
17+
f"account.{company.id}_pcg_4778", False
18+
)
19+
20+
21+
@openupgrade.migrate()
22+
def migrate(env, version):
23+
_assign_default_rounding_account(env)
24+
l10n_fr_xmlids = [
25+
"tax_group_tva_0",
26+
"tax_group_tva_10",
27+
"tax_group_tva_20",
28+
"tax_group_tva_21",
29+
"tax_group_tva_55",
30+
"tax_group_tva_85",
31+
]
32+
openupgrade.delete_records_safely_by_xml_id(
33+
env, [f"l10n_fr.{ref}" for ref in l10n_fr_xmlids]
34+
)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright 2026 Le Filament
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from openupgradelib import openupgrade
4+
5+
6+
def _remove_autocreated_expression(env):
7+
openupgrade.logged_query(
8+
env.cr,
9+
"""
10+
DELETE FROM account_report_expression
11+
WHERE label='balance'
12+
AND report_line_id IN (
13+
SELECT res_id FROM ir_model_data
14+
WHERE module='l10n_fr'
15+
AND name in (
16+
'tax_report_16', 'tax_report_23', 'tax_report_TIC_total',
17+
'tax_report_X4', 'tax_report_Y1', 'tax_report_Y2',
18+
'tax_report_Y3', 'tax_report_Z4', 'tax_report_32')
19+
AND model='account.report.line')
20+
AND id NOT IN (
21+
SELECT res_id FROM ir_model_data
22+
WHERE module='l10n_fr' AND model='account.report.expression'
23+
)
24+
""",
25+
)
26+
27+
28+
@openupgrade.migrate()
29+
def migrate(env, version):
30+
_remove_autocreated_expression(env)

0 commit comments

Comments
 (0)