[19.0][MIG] hr_shift: Migration to 19.0#38
Open
XtremXpert wants to merge 23 commits into
Open
Conversation
TT50623 Co-authored-by: chienandalu [UPD] Update hr_shift.pot [BOT] post-merge updates
Changes done: - Add rules related to shift lines - Add My shifts filter + group by fields - Add template + employee fields to calendar view - Set widget="many2one_avatar_employee" to employee_id field (tree view)
Co-authored-by: neitherkx <dpalancamartinez@gmail.com>
… a template without error (similar to v14)
This module replaces theoretical calendar attendances by the shift ones in a conservative way, only removing those that belong to the exact shift. That way, if no shift is specified, the usual calendar will apply. But when the shift is at or around midnight, there can be 2 dates involved, the starting day, and the ending day. If the calendar assigned to the employee has attendance entries in both of them, the replacing of them won't be correct. Thus, we should remove all the attendances entries belonging to any of the days of the shift, no matter the hours. TT61053
- Replace removed resource.models.utils.string_to_datetime with pytz.utc.localize on naive ORM datetimes - hr.employee.base was merged into hr.employee in Odoo 19 - Convert _sql_constraints to models.Constraint - res.groups: category_id/users replaced by privilege_id/user_ids (new res.groups.privilege record) - Search views: <group> no longer accepts the string attribute - Use naive UTC datetimes in search domains (Odoo 19 requirement) - Replace deprecated self._context with self.env.context - fields.datetime alias removed: use datetime.combine directly - prefer-env-translation: use self.env._() / plain selection labels - Tests still require demo data (--with-demo, no longer the default) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3c76220 to
2577b42
Compare
Member
|
/ocabot migration hr_shift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration of
hr_shiftfrom 18.0 to 19.0, with commit history preserved viagit format-patch.Changes required by Odoo 19
resource.models.utils.string_to_datetimewas removed → localize naive ORM datetimes withpytz.utc.localizedirectlyhr.employee.basewas merged intohr.employee→ inherithr.employee_sql_constraints→models.Constraintres.groups:category_id/usersreplaced byprivilege_id/user_ids, with a newres.groups.privilegerecord<group>no longer accepts thestringattributeself._contextdeprecation →self.env.contextfields.datetimelowercase alias removed →datetime.combineprefer-env-translation(pylint mandatory):self.env._()in methods; selection labels as plain strings (exported by the ORM)no-search-all(pylint mandatory): inline disable on the two_group_expandmethods — shift templates are a small bounded configuration tablesetUpClassinstead ofenv.refon demo records. The templates are created withtz=Europe/Brusselsto preserve the original UTC assertions, and the test user gets a fallback timezone (required by_compute_shift_time). Tests pass both with and without demo data.Notes for reviewers
0 failed, 0 error(s) of 4 testson a fresh 19.0 database, with and without--with-demohr_shift_holidays_public(present in 17.0) is not part of this PR since it was never migrated to 18.0.🤖 Generated with Claude Code