-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][ADD] hr_timesheet_begin_end_no_end #691
base: 16.0
Are you sure you want to change the base?
Conversation
357dc26
to
6cb8367
Compare
6cb8367
to
629c3a2
Compare
629c3a2
to
148010c
Compare
@huguesdk do you want to review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great refactor, thanks @carmenbianca!
please move the commits adding the new module to another pull request (commits on a branch on top of this one), as the refactor should be able to be accepted independently (and the version numbers correctly increased independently too).
148010c
to
b06c240
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hr_timesheet_begin_end_no_end/tests/test_timesheet_begin_end_no_end.py
Outdated
Show resolved
Hide resolved
b06c240
to
495c0ed
Compare
Timesheet lines are characterised by having a project. Signed-off-by: Carmen Bianca BAKKER <[email protected]>
The separation of checks into separate methods is needed because I want to disable one check in another module. This makes the module more extensible. The unit_amount_from_start_stop method also makes the module more extensible. I have also moved the onchange to the top of the file, according to the OCA contribution guidelines. Signed-off-by: Carmen Bianca BAKKER <[email protected]>
495c0ed
to
056d066
Compare
Instead of using onchange, which is less convenient in Odoo 16. Signed-off-by: Carmen Bianca BAKKER <[email protected]>
This is a tricky one. _Technically_ there is nothing that makes hr_timesheet_begin_end incompatible with the other modules here. However, when the project_id on a timesheet line is changed, unit_amount is rerecomputed. This has some consequences. In the sale_timesheet tests, the project_id of a timesheet line is (sometimes?) recomputed. Subsequently, unit_amount is recomputed and set to 0 when it _shouldn't_ be. Under a normal flow this wouldn't be a problem; time_start and time_stop would be populated to correctly recompute unit_amount. But in the tests, they are not. One solution is to, in addition to not recomputing the unit_amount of non-timesheet lines, not recompute the unit_amount of timesheet lines whose time_start and time_stop are both set to 00:00. However, this means that resetting these values to 00:00 does not correctly set unit_amount back to 0, which seems erroneous to me. Marking this module as a rebel module seems like the best course of action to me, even though it would be preferable to test this in conjunction with the other modules. Signed-off-by: Carmen Bianca BAKKER <[email protected]>
056d066
to
5462b52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a cosmetic remark, otherwise lgtm! very clean solution!
Signed-off-by: Carmen Bianca BAKKER <[email protected]>
Signed-off-by: Carmen Bianca BAKKER <[email protected]>
5462b52
to
41d45b3
Compare
Refactored some code in hr_timesheet_begin_end to be more extensible, and to be more Odoo 16-ish.
Then built a module that removes one of the constraints because of a customer request.
Depends on #692. This is based on top of that branch.
Internal task: T12630