odoo-addon-openupgrade-scripts 17.0.1.0.1.237__py3-none-any.whl → 17.0.1.0.1.250__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.
Files changed (16) hide show
  1. odoo/addons/openupgrade_scripts/apriori.py +3 -0
  2. odoo/addons/openupgrade_scripts/scripts/hr_attendance/17.0.2.0/pre-migration.py +36 -0
  3. odoo/addons/openupgrade_scripts/scripts/l10n_es/17.0.5.4/pre-migration.py +115 -0
  4. odoo/addons/openupgrade_scripts/scripts/l10n_es/17.0.5.4/upgrade_analysis_work.txt +3776 -0
  5. odoo/addons/openupgrade_scripts/scripts/membership/17.0.1.0/pre-migration.py +15 -0
  6. odoo/addons/openupgrade_scripts/scripts/membership/17.0.1.0/upgrade_analysis_work.txt +9 -0
  7. odoo/addons/openupgrade_scripts/scripts/mrp/17.0.2.0/post-migration.py +35 -0
  8. odoo/addons/openupgrade_scripts/scripts/mrp/17.0.2.0/pre-migration.py +58 -0
  9. odoo/addons/openupgrade_scripts/scripts/mrp/17.0.2.0/upgrade_analysis_work.txt +101 -0
  10. odoo/addons/openupgrade_scripts/scripts/mrp_landed_costs/17.0.1.0/upgrade_analysis_work.txt +5 -0
  11. odoo/addons/openupgrade_scripts/scripts/privacy_lookup/17.0.1.0/upgrade_analysis_work.txt +5 -0
  12. odoo/addons/openupgrade_scripts/scripts/sale_mrp/17.0.1.0/upgrade_analysis_work.txt +5 -0
  13. {odoo_addon_openupgrade_scripts-17.0.1.0.1.237.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.250.dist-info}/METADATA +1 -1
  14. {odoo_addon_openupgrade_scripts-17.0.1.0.1.237.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.250.dist-info}/RECORD +16 -6
  15. {odoo_addon_openupgrade_scripts-17.0.1.0.1.237.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.250.dist-info}/WHEEL +0 -0
  16. {odoo_addon_openupgrade_scripts-17.0.1.0.1.237.dist-info → odoo_addon_openupgrade_scripts-17.0.1.0.1.250.dist-info}/top_level.txt +0 -0
@@ -39,7 +39,10 @@ merged_modules = {
39
39
  "website_sale_stock_product_configurator": "website_sale_product_configurator",
40
40
  # OCA/account-invoicing
41
41
  "account_invoice_fiscal_position_update": "account",
42
+ # OCA/hr-attendance
43
+ "hr_attendance_geolocation": "hr_attendance",
42
44
  # OCA/l10n-spain
45
+ "l10n_es_dua": "l10n_es",
43
46
  "l10n_es_irnr": "l10n_es",
44
47
  "l10n_es_irnr_sii": "l10n_es_aeat_sii_oca",
45
48
  # OCA/maintenance
@@ -1,4 +1,5 @@
1
1
  # Copyright 2025 ForgeFlow S.L. (https://www.forgeflow.com)
2
+ # Copyright 2024 Tecnativa - Víctor Martínez
2
3
  # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3
4
  from openupgradelib import openupgrade
4
5
 
@@ -14,6 +15,40 @@ _xmlid_renames = [
14
15
  ]
15
16
 
16
17
 
18
+ def _hr_attendance_geolocation(env):
19
+ """Rename the fields if the hr_attendance_geolocation module was installed."""
20
+ if openupgrade.column_exists(env.cr, "hr_attendance", "check_in_latitude"):
21
+ openupgrade.rename_fields(
22
+ env,
23
+ [
24
+ (
25
+ "hr.attendance",
26
+ "hr_attendance",
27
+ "check_in_latitude",
28
+ "in_latitude",
29
+ ),
30
+ (
31
+ "hr.attendance",
32
+ "hr_attendance",
33
+ "check_in_longitude",
34
+ "in_longitude",
35
+ ),
36
+ (
37
+ "hr.attendance",
38
+ "hr_attendance",
39
+ "check_out_latitude",
40
+ "out_latitude",
41
+ ),
42
+ (
43
+ "hr.attendance",
44
+ "hr_attendance",
45
+ "check_out_longitude",
46
+ "out_longitude",
47
+ ),
48
+ ],
49
+ )
50
+
51
+
17
52
  def pre_create_hr_attendance_overtime_hours(env):
18
53
  openupgrade.logged_query(
19
54
  env.cr,
@@ -42,5 +77,6 @@ def fill_res_company_attendance_from_systray(env):
42
77
  @openupgrade.migrate()
43
78
  def migrate(env, version):
44
79
  openupgrade.rename_xmlids(env.cr, _xmlid_renames)
80
+ _hr_attendance_geolocation(env)
45
81
  pre_create_hr_attendance_overtime_hours(env)
46
82
  fill_res_company_attendance_from_systray(env)
@@ -0,0 +1,115 @@
1
+ # Copyright 2025 Tecnativa - Carlos Roca
2
+ # Copyright 2025 Tecnativa - Pedro M. Baeza
3
+ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
4
+ from openupgradelib import openupgrade
5
+
6
+
7
+ def _pre_create_and_fill_l10n_es_is_simplified(env):
8
+ openupgrade.logged_query(
9
+ env.cr,
10
+ "ALTER TABLE account_move ADD COLUMN l10n_es_is_simplified BOOL DEFAULT false",
11
+ )
12
+ openupgrade.logged_query(
13
+ env.cr,
14
+ "ALTER TABLE account_move ALTER COLUMN l10n_es_is_simplified DROP DEFAULT",
15
+ )
16
+ # The field is filled with the first part of the compute without considering the
17
+ # partner_simplified part, as this record is created during the installation.
18
+ openupgrade.logged_query(
19
+ env.cr,
20
+ """
21
+ UPDATE account_move
22
+ SET l10n_es_is_simplified = (
23
+ partner_id IS NULL
24
+ AND move_type IN ('in_receipt', 'out_receipt')
25
+ )
26
+ """,
27
+ )
28
+
29
+
30
+ def _xml_id_renaming_account_tax_template(env):
31
+ # In 17.0 the tax template xml_id of Intra-Community (Goods) is changed. With
32
+ # this method the xml_id is set correctly.
33
+ imds = env["ir.model.data"].search(
34
+ [
35
+ ("module", "=", "account"),
36
+ ("model", "=", "account.tax"),
37
+ ("name", "=like", "%_account_tax_template_s_iva0_ic"),
38
+ ]
39
+ )
40
+ for imd in imds:
41
+ imd.name = imd.name.replace(
42
+ "account_tax_template_s_iva0_ic", "account_tax_template_s_iva0_g_i"
43
+ )
44
+
45
+
46
+ def _remove_xml_id_account_fiscal_position(env):
47
+ # In 17.0 account.fiscal.position.tax and account.fiscal.position.account don't have
48
+ # xml_id. With this method they are removed.
49
+ for company in env["res.company"].search([]):
50
+ openupgrade.logged_query(
51
+ env.cr,
52
+ f"""
53
+ DELETE FROM ir_model_data
54
+ WHERE module='l10n_es'
55
+ AND model IN (
56
+ 'account.fiscal.position.tax', 'account.fiscal.position.account'
57
+ ) AND name LIKE '{company.id}_%'
58
+ """,
59
+ )
60
+
61
+
62
+ def _handle_dua_transition(env):
63
+ """Handle if you had l10n_es_dua module from OCA/l10n-spain installed."""
64
+ openupgrade.rename_xmlids(
65
+ env.cr,
66
+ [
67
+ ("l10n_es.producto_dua_valoracion_21", "l10n_es.product_dua_valuation_21"),
68
+ ("l10n_es.producto_dua_valoracion_10", "l10n_es.product_dua_valuation_10"),
69
+ ("l10n_es.producto_dua_valoracion_4", "l10n_es.product_dua_valuation_4"),
70
+ (
71
+ "l10n_es.producto_dua_valoracion_21_product_template",
72
+ "l10n_es.product_dua_valuation_21_product_template",
73
+ ),
74
+ (
75
+ "l10n_es.producto_dua_valoracion_10_product_template",
76
+ "l10n_es.product_dua_valuation_10_product_template",
77
+ ),
78
+ (
79
+ "l10n_es.producto_dua_valoracion_4_product_template",
80
+ "l10n_es.product_dua_valuation_4_product_template",
81
+ ),
82
+ ],
83
+ )
84
+ record = env.ref("l10n_es.producto_dua_compensacion", False)
85
+ if record:
86
+ record.active = False
87
+ # Tax groups
88
+ imds = env["ir.model.data"].search(
89
+ [
90
+ ("name", "=like", "%_tax_group_dua_exento"),
91
+ ("model", "=", "account.tax.group"),
92
+ ]
93
+ )
94
+ for imd in imds:
95
+ imd.name = imd.name.replace("tax_group_dua_exento", "tax_group_dua_exempt")
96
+ # Taxes
97
+ imds = env["ir.model.data"].search(
98
+ [
99
+ ("name", "=like", "%_account_tax_template_p_dua0"),
100
+ ("module", "=", "account"),
101
+ ("model", "=", "account.tax"),
102
+ ]
103
+ )
104
+ for imd in imds:
105
+ imd.name = imd.name.replace(
106
+ "account_tax_template_p_dua0", "account_tax_template_p_dua_exempt"
107
+ )
108
+
109
+
110
+ @openupgrade.migrate()
111
+ def migrate(env, version):
112
+ _pre_create_and_fill_l10n_es_is_simplified(env)
113
+ _xml_id_renaming_account_tax_template(env)
114
+ _remove_xml_id_account_fiscal_position(env)
115
+ _handle_dua_transition(env)