odoo-addon-openupgrade-scripts 18.0.1.0.0.401__py3-none-any.whl → 18.0.1.0.0.406__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.
@@ -42,6 +42,15 @@ _new_columns = [
42
42
  ]
43
43
 
44
44
 
45
+ def _drop_sql_views(env):
46
+ openupgrade.logged_query(
47
+ env.cr,
48
+ """
49
+ DROP VIEW IF EXISTS account_root
50
+ """,
51
+ )
52
+
53
+
45
54
  def rename_selection_option(env):
46
55
  openupgrade.logged_query(
47
56
  env.cr,
@@ -218,6 +227,7 @@ def migrate(env, version):
218
227
  openupgrade.rename_fields(env, field_renames_l10n_dk_bookkeeping)
219
228
  openupgrade.rename_fields(env, field_renames)
220
229
  openupgrade.add_columns(env, _new_columns)
230
+ _drop_sql_views(env)
221
231
  update_account_move_amount_untaxed_in_currency_signed(env)
222
232
  update_account_move_checked(env)
223
233
  fill_account_move_preferred_payment_method_line_id(env)
@@ -12,6 +12,9 @@ new model account.move.send.wizard [transient]
12
12
  new model account.secure.entries.wizard [transient]
13
13
  # NOTHING TO DO
14
14
 
15
+ obsolete model account.root [sql_view]
16
+ # DONE: pre-migration: drop view if exists
17
+
15
18
  ---Fields in module 'account'---
16
19
  account / account.account / _order : _order is now 'code, placeholder_code' ('code, company_id')
17
20
  account / account.account / code_mapping_ids (one2many) : NEW relation: account.code.mapping
@@ -51,7 +51,7 @@ def update_states(env):
51
51
  env.cr,
52
52
  """
53
53
  UPDATE hr_leave_allocation
54
- SET state = 'cancel'
54
+ SET state = 'refuse'
55
55
  WHERE active IS DISTINCT FROM TRUE
56
56
  """,
57
57
  )
@@ -77,7 +77,26 @@ def update_allocation_validation_type(env):
77
77
 
78
78
 
79
79
  def split_employee_leaves(env):
80
+ """
81
+ Confirmed leave or allocation already have duplicated leave for each employee
82
+ Since multi employee leave / allocation are not allowed anymore,
83
+ these should be removed
84
+ Draft (= 'confirm' state) are the only ones which have not yet
85
+ been duplicated and therefore should be transformed
86
+ """
80
87
  for table in ["hr_leave", "hr_leave_allocation"]:
88
+ # First remove all multi-employee leaves / allocations
89
+ # already confirmed or refused
90
+ openupgrade.logged_query(
91
+ env.cr,
92
+ f"""
93
+ DELETE FROM {table}
94
+ WHERE state IN ('refuse', 'validate1', 'validate', 'cancel') AND (
95
+ (holiday_type = 'employee' AND multi_employee)
96
+ OR holiday_type IN ('company', 'category', 'department'))
97
+ """,
98
+ )
99
+ # Then for the remaining ones we transform existing data for each employee
81
100
  env.cr.execute(
82
101
  f"""
83
102
  SELECT column_name
@@ -134,7 +153,7 @@ def split_employee_leaves(env):
134
153
  )
135
154
  leave_employees.extend(env.cr.fetchall())
136
155
  for table_id, holiday_type, employee_ids in leave_employees:
137
- employees = env["hr.employee"].browse(employee_ids)
156
+ employees = env["hr.employee"].browse(employee_ids).filtered("active")
138
157
  if employee_ids:
139
158
  openupgrade.logged_query(
140
159
  env.cr,
@@ -24,7 +24,7 @@ hr_holidays / hr.leave / parent_id (many2one) : DEL re
24
24
  hr_holidays / hr.leave.allocation / parent_id (many2one) : DEL relation: hr.leave.allocation
25
25
  hr_holidays / hr.leave / employee_id (many2one) : now required
26
26
  hr_holidays / hr.leave.allocation / employee_id (many2one) : now required
27
- # DONE: pre-migration: split leaves, one for each employee
27
+ # DONE: pre-migration: split leaves / allocations, one for each employee (only for draft leaves / allocations)
28
28
 
29
29
  hr_holidays / hr.leave / report_note (text) : DEL
30
30
  # NOTHING TO DO: deprecated (https://github.com/odoo/odoo/commit/ca34732081b1ce6c339dd941abb9696861d95878)
@@ -39,7 +39,7 @@ hr_holidays / hr.leave / active (boolean) : DEL
39
39
  hr_holidays / hr.leave.allocation / active (boolean) : DEL
40
40
  hr_holidays / hr.leave / state (selection) : selection_keys added: [cancel], removed: [draft]
41
41
  hr_holidays / hr.leave.allocation / state (selection) : selection_keys added: [validate1] (most likely nothing to do)
42
- # DONE: pre-migration: set state = 'cancel' if archived. Also, 'draft' set to 'confirm' for leaves
42
+ # DONE: pre-migration: set state = 'cancel' for leaves / 'refuse' for allocations if archived. Also, 'draft' set to 'confirm' for leaves
43
43
 
44
44
  hr_holidays / hr.leave.accrual.level / accrual_validity (boolean) : NEW
45
45
  hr_holidays / hr.leave.accrual.level / accrual_validity_count (integer): NEW hasdefault: default
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-openupgrade_scripts
3
- Version: 18.0.1.0.0.401
3
+ Version: 18.0.1.0.0.406
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: odoo==18.0.*
6
6
  Requires-Dist: openupgradelib
@@ -7,9 +7,9 @@ odoo/addons/openupgrade_scripts/readme/DESCRIPTION.md,sha256=6hwHccovmE9cfaV7PQP
7
7
  odoo/addons/openupgrade_scripts/readme/INSTALL.md,sha256=NDKVZRv0J8BTqcSTD7JwUXL_AY-cDJoegn5IUTbEOFk,113
8
8
  odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/noupdate_changes.xml,sha256=givzahE7VAv9gM1TkNDHs3qhNh3AZacox5q-hDuDjIU,4078
9
9
  odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/post-migration.py,sha256=hZRueZ0yktDoBfB1_o7rQjXkTmAB4DfyK9YkXC5G3hU,6547
10
- odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/pre-migration.py,sha256=WfnU5dP1a6Xxoz_kr7QzKpgycCGFhlAOvKtHM2fm3ok,8249
10
+ odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/pre-migration.py,sha256=8lgeeCdLEQtK2FfTqhJV8gKvlZEC5YWyTEKtuLPrbhw,8420
11
11
  odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/upgrade_analysis.txt,sha256=xpQwQxWn0ktacfLBgmRuRMjvSY9R4ClAQlfLJRs35Tg,21369
12
- odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/upgrade_analysis_work.txt,sha256=IHraqatQaxlTvOPt0HE9Uca1y_qw1ZsUF-fB2PnQIH8,25211
12
+ odoo/addons/openupgrade_scripts/scripts/account/18.0.1.3/upgrade_analysis_work.txt,sha256=z-IqChSmDrYuRklaEolzi648dTC_J-dNE67q7Taf5hw,25294
13
13
  odoo/addons/openupgrade_scripts/scripts/account/tests/data.py,sha256=beOIEOzb6-hvlpjM9VVZrSj8pqZ6U7AcrS-w3vkTgsU,490
14
14
  odoo/addons/openupgrade_scripts/scripts/account/tests/test_migration.py,sha256=UsHOHhSkUkmcm4inSE8VgFIn79E-6i9FXt3v6jHW5HY,791
15
15
  odoo/addons/openupgrade_scripts/scripts/account_check_printing/18.0.1.0/upgrade_analysis.txt,sha256=IY2z67lgzVtwG7Zzj71ks2why2Hwuz-mRPy9xEqfBcY,675
@@ -173,9 +173,9 @@ odoo/addons/openupgrade_scripts/scripts/hr_gamification/18.0.1.0/upgrade_analysi
173
173
  odoo/addons/openupgrade_scripts/scripts/hr_gamification/18.0.1.0/upgrade_analysis_work.txt,sha256=oSFbmry-ZHC6woVmqO7_1wG95gy-H_kdPsReRk00mmw,221
174
174
  odoo/addons/openupgrade_scripts/scripts/hr_holidays/18.0.1.6/noupdate_changes.xml,sha256=E-oKUt2VpNCp5PBeS5ObcIhTYZWC2C7nWPwOuz19LCg,3401
175
175
  odoo/addons/openupgrade_scripts/scripts/hr_holidays/18.0.1.6/post-migration.py,sha256=a1p-Q0nFVU7_ubvUavqdqXbbXD72Oq-t-OEIeBopXLU,391
176
- odoo/addons/openupgrade_scripts/scripts/hr_holidays/18.0.1.6/pre-migration.py,sha256=MRLHSA0wh6FvpkH_xOGQR6uIb_ZWe82D3dZZdWtW7i0,6008
176
+ odoo/addons/openupgrade_scripts/scripts/hr_holidays/18.0.1.6/pre-migration.py,sha256=FWdg5mmLDal-6qZX5xHrOT-uAyfhbXtpnBBotg3Cmik,6876
177
177
  odoo/addons/openupgrade_scripts/scripts/hr_holidays/18.0.1.6/upgrade_analysis.txt,sha256=QO0s2zJ1gsHefzOlYM41AqHEoFV51LjCXX54FaQSytY,7273
178
- odoo/addons/openupgrade_scripts/scripts/hr_holidays/18.0.1.6/upgrade_analysis_work.txt,sha256=674IOc6ypcPJIJ_WT53KR2KNfniFm8767w0cJRfp-Go,8104
178
+ odoo/addons/openupgrade_scripts/scripts/hr_holidays/18.0.1.6/upgrade_analysis_work.txt,sha256=5IuIOCk7RS8qNS0I__jk6oTIzFPdapsgB69wZ2wCyKY,8194
179
179
  odoo/addons/openupgrade_scripts/scripts/hr_holidays_attendance/18.0.1.0/noupdate_changes.xml,sha256=sWWTZMos_-pK34q9IbuuGBm_SlViQgwBjOdUOK89Gr4,170
180
180
  odoo/addons/openupgrade_scripts/scripts/hr_holidays_attendance/18.0.1.0/post-migration.py,sha256=XnPw5pJJzXpMHW2VCy3a0OB08UQ2hDuIbcOMOoJwwkQ,195
181
181
  odoo/addons/openupgrade_scripts/scripts/hr_holidays_attendance/18.0.1.0/upgrade_analysis.txt,sha256=7nl-oLoVeH_SzL74vALQ6GkztPLW6k04Wvl_49U_vmU,189
@@ -789,7 +789,7 @@ odoo/addons/openupgrade_scripts/scripts/website_slides_survey/18.0.1.0/upgrade_a
789
789
  odoo/addons/openupgrade_scripts/static/description/banner.png,sha256=KTIBu4gfxeZVw9zjs_fivTgFEOeaAorlBxajmCA1p6k,26859
790
790
  odoo/addons/openupgrade_scripts/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
791
791
  odoo/addons/openupgrade_scripts/static/description/index.html,sha256=Jc0qAThlH5WnoSq6vPamjC8WyMkdo_9zkhDuU1qW1VI,12722
792
- odoo_addon_openupgrade_scripts-18.0.1.0.0.401.dist-info/METADATA,sha256=sbY1BR3oXvL6ucBP2cvL60IrjA-8HLaLAScKoZCNl7o,3812
793
- odoo_addon_openupgrade_scripts-18.0.1.0.0.401.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
794
- odoo_addon_openupgrade_scripts-18.0.1.0.0.401.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
795
- odoo_addon_openupgrade_scripts-18.0.1.0.0.401.dist-info/RECORD,,
792
+ odoo_addon_openupgrade_scripts-18.0.1.0.0.406.dist-info/METADATA,sha256=ZXsPN1tj4RFF78IYHBMKAB7TF8LPHehFAqr-Vpvp5J8,3812
793
+ odoo_addon_openupgrade_scripts-18.0.1.0.0.406.dist-info/WHEEL,sha256=ZhOvUsYhy81Dx67gN3TV0RchQWBIIzutDZaJODDg2Vo,81
794
+ odoo_addon_openupgrade_scripts-18.0.1.0.0.406.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
795
+ odoo_addon_openupgrade_scripts-18.0.1.0.0.406.dist-info/RECORD,,