Repository navigation
[20.0][MIG] hr_timesheet_begin_end: Migration to 20.0 - #983
weinni2000 wants to merge 14 commits into
Conversation
[UPD] Update hr_timesheet_begin_end.pot [UPD] README.rst Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: timesheet-16.0/timesheet-16.0-hr_timesheet_begin_end Translate-URL: https://translation.odoo-community.org/projects/timesheet-16-0/timesheet-16-0-hr_timesheet_begin_end/ [UPD] README.rst
Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (6 of 6 strings) Translation: timesheet-16.0/timesheet-16.0-hr_timesheet_begin_end Translate-URL: https://translation.odoo-community.org/projects/timesheet-16-0/timesheet-16-0-hr_timesheet_begin_end/pt_BR/
Translated using Weblate (Catalan) Currently translated at 100.0% (6 of 6 strings) Translation: timesheet-16.0/timesheet-16.0-hr_timesheet_begin_end Translate-URL: https://translation.odoo-community.org/projects/timesheet-16-0/timesheet-16-0-hr_timesheet_begin_end/ca/
|
Hi @bertstomphorst @NICO-SOLUTIONS, your earlier commits are part of this migration, and the CLA check fails for bert@advisto.nl and 74965194+NICO-SOLUTIONS@users.noreply.github.com. Could you sign at https://clabot.odoo-community.org/ (or have them added to your company's CLA)? Thanks! |
@weinni2000 done |
f27e652 to
61567e4
Compare
|
@CRogos @NICO-SOLUTIONS: |
|
Sorry I am not using this module anymore and can't stop advertising ;-) https://github.com/OCA/timesheet/tree/19.0/hr_timesheet_time_control_begin_end PS: adminstrative commits are not squashed |
61567e4 to
f0607c9
Compare
Same here. I’m also using the module that Crogos mentioned. I guess there are still quite a few people using it and who might want to stick with it, so we should continue supporting it here as well. I’ll take a closer look when I find some time. Besides that, Crogos is right when it comes to squashing. |
NICO-SOLUTIONS
left a comment
There was a problem hiding this comment.
Functional and code review: LGTM.
Please also squash the left UPD commit according to the OCA merge/squash guidelines.
rrebollo
left a comment
There was a problem hiding this comment.
Installed this head into a fresh 20.0 database with sale_timesheet and ran the module's suite: it installs clean, the tests pass, and every view anchor resolves. The uom.uom.rounding replacement is faithful — compare() resolves to the same two-digit Product Unit precision the removed field exposed, and it is the idiom upstream's own commit uses. The migration is otherwise complete against the 20.0 guide: version bumped, no ACL to move to ir.access, no Font Awesome icons, TransactionCase so _test_user_groups does not apply. What remains is the added fields not following a mechanism 20.0 introduced in these very views, plus one naming nit. The view finding was confirmed in the web client on a reinvoiced line, not only in the arch. Please consider my concerns. Also would you be so kind to review some of my current open PRs #990 and #991 ?
| <field name="time_start" widget="float_time" optional="show" /> | ||
| <field name="time_stop" widget="float_time" optional="show" /> |
There was a problem hiding this comment.
Every field the core timesheet list and form expose is gated by readonly="readonly_timesheet" — new in 20.0 (hr_timesheet/models/account_analytic_line.py:117), true for billed and time-off lines. These two are not, so Begin/End Hour stay editable while unit_amount, the value the constraint compares against, is locked. Reproduced in the web client on a reinvoiced line: date, name and unit_amount render read-only, Begin Hour is an input, and changing it raises "The duration (02:00) must be equal to the difference between the hours (03:00)", which the locked field cannot fix.
| <field name="time_start" widget="float_time" optional="show" /> | |
| <field name="time_stop" widget="float_time" optional="show" /> | |
| <field name="time_start" widget="float_time" optional="show" readonly="readonly_timesheet" /> | |
| <field name="time_stop" widget="float_time" optional="show" readonly="readonly_timesheet" /> |
| <field name="time_start" widget="float_time" /> | ||
| <field name="time_stop" widget="float_time" /> |
There was a problem hiding this comment.
| <field name="time_start" widget="float_time" /> | |
| <field name="time_stop" widget="float_time" /> | |
| <field name="time_start" widget="float_time" readonly="readonly_timesheet" /> | |
| <field name="time_stop" widget="float_time" readonly="readonly_timesheet" /> |
| <field name="time_start" widget="float_time" /> | ||
| <field name="time_stop" widget="float_time" /> |
There was a problem hiding this comment.
| <field name="time_start" widget="float_time" /> | |
| <field name="time_stop" widget="float_time" /> | |
| <field name="time_start" widget="float_time" readonly="readonly_timesheet" /> | |
| <field name="time_stop" widget="float_time" readonly="readonly_timesheet" /> |
| <field name="time_start" widget="float_time" /> | ||
| <field name="time_stop" widget="float_time" /> |
There was a problem hiding this comment.
| <field name="time_start" widget="float_time" /> | |
| <field name="time_stop" widget="float_time" /> | |
| <field name="time_start" widget="float_time" readonly="readonly_timesheet" /> | |
| <field name="time_stop" widget="float_time" readonly="readonly_timesheet" /> |
| hour_uom_id = self.env.ref("uom.product_uom_hour") | ||
| if hours and hour_uom_id.compare(hours, line.unit_amount): |
There was a problem hiding this comment.
hour_uom_id holds a uom.uom recordset, not an id — the _id suffix is reserved for a record id and leaves the next reader expecting an int.
| hour_uom_id = self.env.ref("uom.product_uom_hour") | |
| if hours and hour_uom_id.compare(hours, line.unit_amount): | |
| hour_uom = self.env.ref("uom.product_uom_hour") | |
| if hours and hour_uom.compare(hours, line.unit_amount): |
The validation for overlapping times was done on user_id, which is the user entering the lines. This should be on employee_id, the employee *for who* the times are entered.
Odoo 20 removes uom.uom.rounding. Use the unit comparison API to keep duration validation consistent with Product Unit precision. Upstream: odoo/odoo@9a4ad7c
f0607c9 to
804b7b8
Compare
Migrate
hr_timesheet_begin_endto Odoo 20.0, preserving the module history with the OCA migration flow.Replace the removed
uom.uom.roundingaccess withuom.uom.compare()so duration validation continues to use Product Unit precision. Rename the view files per model and regenerate the README for 20.0.Validation:
/hr_timesheet_begin_end).Upstream API change: odoo/odoo@9a4ad7c