Repository navigation
[16.0][MIG] hr_shift: Migration to 16.0 - #53
juanalfonsocb wants to merge 40 commits into
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)
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: shift-planning-15.0/shift-planning-15.0-hr_shift Translate-URL: https://translation.odoo-community.org/projects/shift-planning-15-0/shift-planning-15-0-hr_shift/
Use case example: - Create an hr.shift.planning.line record with a start time of 00:00:00 and an end time of 08:00:00 - The employee must have a work schedule after 08:00:00 (for example, starting at 13:00:00) - The report from the hr_attendance_report_theoretical_time module is used. The hr_shift methods will mix records and cause an error. TypeError: cannot union different models: 'hr.shift.planning.line()' and 'resource.calendar.attendance()' TT60298
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
b9e38d1 to
c1c0c94
Compare
c1c0c94 to
d3c82cd
Compare
e2f5dc8 to
e02a7ae
Compare
|
The changes you made should be ported to other versions. It would be better to put that changes in another commits to simplify the forward-port |
hr_shift (OCA#53) is not yet merged into this branch, so it's installed from its own branch just for running tests.
hr_shift (OCA#53) is not yet merged into this branch, so it's installed from its own branch just for running tests.
e02a7ae to
7b8f1fd
Compare
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: shift-planning-18.0/shift-planning-18.0-hr_shift Translate-URL: https://translation.odoo-community.org/projects/shift-planning-18-0/shift-planning-18-0-hr_shift/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: shift-planning-18.0/shift-planning-18.0-hr_shift Translate-URL: https://translation.odoo-community.org/projects/shift-planning-18-0/shift-planning-18-0-hr_shift/
Currently translated at 100.0% (111 of 111 strings) Translation: shift-planning-18.0/shift-planning-18.0-hr_shift Translate-URL: https://translation.odoo-community.org/projects/shift-planning-18-0/shift-planning-18-0-hr_shift/it/
The compute filled current_shift_id with any shift scheduled today using a UTC-day window. In non-UTC timezones (GMT-10), the day boundary splits across two UTC days and same-day shifts can raise a SingletonError on the Many2one assignment. Switch _shift_of_date's domain from containment to overlap and call it with (now, now) so the field matches the shift covering this instant, as its name implies. Night shifts crossing midnight are covered as a side effect. _shift_of_date is kept as a public hook. Assisted-by: Claude Opus 4.7
Currently translated at 100.0% (111 of 111 strings) Translation: shift-planning-18.0/shift-planning-18.0-hr_shift Translate-URL: https://translation.odoo-community.org/projects/shift-planning-18-0/shift-planning-18-0-hr_shift/sl/
Currently translated at 100.0% (1 of 1 strings) Translation: shift-planning-18.0/shift-planning-18.0-hr_shift_holidays_public Translate-URL: https://translation.odoo-community.org/projects/shift-planning-18-0/shift-planning-18-0-hr_shift_holidays_public/sl/
06cde1e to
1f5f42d
Compare
|
@juanalfonsocb There is already another migration PR #35 |
|
True, but this one includes all the benefits of the future versions. @hitrosol as original author of the first migration, maybe you have some comments to share. |
|
Thanks @juanalfonsocb for this work, and @etobella for the ping. I agree that this PR is more complete than #35. It already includes the improvements from later versions. I'll close #35 in favour of it. While testing on runboat, I found a blocking error: Steps to reproduce: File "/opt/odoo/odoo/models.py", line 1783, in _read_group_fill_results maybe by adding order=None in def _group_expand_template_id will solve this problem. |
|
It has been fixed; thanks for the review @hitrosol |
3383bdb to
5ed852b
Compare
Adapt to 16.0
Implemented changes