odoo-addon-openupgrade-scripts 17.0.1.0.1.337__py3-none-any.whl → 17.0.1.0.1.343__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,6 +51,7 @@ merged_modules = {
51
51
  "l10n_de_skr04_mis_reports": "l10n_de_mis_reports",
52
52
  # OCA/l10n-spain
53
53
  "l10n_es_dua": "l10n_es",
54
+ "l10n_es_dua_sii": "l10n_es_aeat_sii_oca",
54
55
  "l10n_es_irnr": "l10n_es",
55
56
  "l10n_es_irnr_sii": "l10n_es_aeat_sii_oca",
56
57
  # OCA/maintenance
@@ -0,0 +1,32 @@
1
+ # Copyright 2025 Tecnativa - Pedro M. Baeza
2
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3
+ from openupgradelib import openupgrade
4
+
5
+
6
+ def _remove_xml_id_account_fiscal_position(env):
7
+ """In 17.0 account.fiscal.position.tax and account.fiscal.position.account don't
8
+ have XML-IDs. With this method they are removed.
9
+ """
10
+ for company in env["res.company"].search([]):
11
+ openupgrade.logged_query(
12
+ env.cr,
13
+ f"""
14
+ DELETE FROM ir_model_data
15
+ WHERE module='l10n_de'
16
+ AND model IN (
17
+ 'account.fiscal.position.tax', 'account.fiscal.position.account'
18
+ ) AND name LIKE '{company.id}_%'
19
+ """,
20
+ )
21
+
22
+
23
+ @openupgrade.migrate()
24
+ def migrate(env, version):
25
+ openupgrade.rename_xmlids(
26
+ env.cr,
27
+ [
28
+ ("l10n_de.l10n_de_chart_template", "l10n_de.de_skr03"),
29
+ ("l10n_de.l10n_chart_de_skr04", "l10n_de.de_skr04"),
30
+ ],
31
+ )
32
+ _remove_xml_id_account_fiscal_position(env)