Skip to content

Commit

Permalink
Merge PR #4471 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by legalsylvain
  • Loading branch information
OCA-git-bot committed Nov 6, 2024
2 parents 1456517 + e3b0e00 commit 7c84bd8
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docsource/modules160-170.rst
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ Module coverage 16.0 -> 17.0
+---------------------------------------------------+----------------------+-------------------------------------------------+
| repair | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| resource | | |
| resource |Done | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
| sale | | |
+---------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
17 changes: 17 additions & 0 deletions openupgrade_scripts/scripts/resource/17.0.1.1/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade

_deleted_xml_records = [
"resource.resource_calendar_std_35h",
"resource.resource_calendar_std_38h",
]


@openupgrade.migrate()
def migrate(env, version):
openupgrade.delete_records_safely_by_xml_id(
env,
_deleted_xml_records,
)
16 changes: 16 additions & 0 deletions openupgrade_scripts/scripts/resource/17.0.1.1/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
openupgrade.set_xml_ids_noupdate_value(
env,
"resource",
[
"resource_calendar_std",
],
True,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---Models in module 'resource'---
---Fields in module 'resource'---
resource / resource.calendar / hours_per_day (float) : now a function
# Nothing To Do, compute non-stored

resource / resource.calendar.attendance / _order : _order is now 'sequence, week_type, dayofweek, hour_from' ('week_type, dayofweek, hour_from')
# Nothing To Do, default order when search

resource / resource.calendar.attendance / day_period (selection) : selection_keys is now '['afternoon', 'lunch', 'morning']' ('['afternoon', 'morning']')
# Nothing To Do, new option: lunch

resource / resource.calendar.attendance / duration_days (float) : NEW hasdefault: compute
# Nothing To Do, no need precomputation

---XML records in module 'resource'---
resource.calendar: resource.resource_calendar_std (noupdate) (noupdate switched)
# DONE: switched noupdate

DEL resource.calendar: resource.resource_calendar_std_35h (noupdate)
DEL resource.calendar: resource.resource_calendar_std_38h (noupdate)
# DONE: safely delete in post-migration

0 comments on commit 7c84bd8

Please sign in to comment.