Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docsource/modules160-170.rst
Original file line number Diff line number Diff line change
Expand Up @@ -364,19 +364,19 @@ Module coverage 16.0 -> 17.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| l10n_fi_sale | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| l10n_fr | | |
| l10n_fr | Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| l10n_fr_facturx_chorus_pro | |No DB layout changes. |
| l10n_fr_facturx_chorus_pro | Nothing to do |No DB layout changes. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| l10n_fr_fec | |No DB layout changes. |
| l10n_fr_fec | Nothing to do |No DB layout changes. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| |new| l10n_fr_hr_holidays | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| |new| l10n_fr_hr_work_entry_holidays | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| l10n_fr_invoice_addr | |No DB layout changes. |
| l10n_fr_invoice_addr | Nothing to do |No DB layout changes. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| l10n_fr_pos_cert | |No DB layout changes. |
| l10n_fr_pos_cert | Nothing to do |No DB layout changes. |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| |new| l10n_ga | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
34 changes: 34 additions & 0 deletions openupgrade_scripts/scripts/l10n_fr/17.0.2.1/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2026 Le Filament
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openupgradelib import openupgrade


def _assign_default_rounding_account(env):
fr_company_ids = (
env["res.company"]
.search([])
.filtered(lambda c: c.country_code in c._get_france_country_codes())
)
for company in fr_company_ids:
company.l10n_fr_rounding_difference_loss_account_id = env.ref(
f"account.{company.id}_pcg_4768", False
)
company.l10n_fr_rounding_difference_profit_account_id = env.ref(
f"account.{company.id}_pcg_4778", False
)


@openupgrade.migrate()
def migrate(env, version):
_assign_default_rounding_account(env)
l10n_fr_xmlids = [
"tax_group_tva_0",
"tax_group_tva_10",
"tax_group_tva_20",
"tax_group_tva_21",
"tax_group_tva_55",
"tax_group_tva_85",
]
openupgrade.delete_records_safely_by_xml_id(
env, [f"l10n_fr.{ref}" for ref in l10n_fr_xmlids]
)
30 changes: 30 additions & 0 deletions openupgrade_scripts/scripts/l10n_fr/17.0.2.1/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2026 Le Filament
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from openupgradelib import openupgrade


def _remove_autocreated_expression(env):
openupgrade.logged_query(
env.cr,
"""
DELETE FROM account_report_expression
WHERE label='balance'
AND report_line_id IN (
SELECT res_id FROM ir_model_data
WHERE module='l10n_fr'
AND name in (
'tax_report_16', 'tax_report_23', 'tax_report_TIC_total',
'tax_report_X4', 'tax_report_Y1', 'tax_report_Y2',
'tax_report_Y3', 'tax_report_Z4', 'tax_report_32')
AND model='account.report.line')
AND id NOT IN (
SELECT res_id FROM ir_model_data
WHERE module='l10n_fr' AND model='account.report.expression'
)
""",
)


@openupgrade.migrate()
def migrate(env, version):
_remove_autocreated_expression(env)
Loading