-
-
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
[11.0][IMP] hr_timesheet_sheet: fix amount calculation issues + code simplification #207
Conversation
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.
This PR implicitly includes a fix for the negative amounts. The solution is a bit alternative to #201.
That's not a fix for the negative amounts. It's just the removal of the non negative amounts condition as in #201. And then, why do you propose an alternative? What's wrong with the #201? Now, will reviewers need to choose between two PRs? I don't understand. I think you could propose here only the other changes (the ones solving your issue #206) instead of doing also commits that enter in conflict with #201. If you want changes, then request changes in my PR, but don't open alternative PRs regarding a same topic (negative amounts). Also, I could be happy to include the solution of your issue in #201, it's easy.
@mreficent While simplifying that method, I just deleted the same 2 lines you already deleted in your PR. That was necessary because of the design of this PR, the reason is already explained above: this PR fixes the decreasing of the amounts, and decreasing by setting negative amounts is also part of the cases fixed by this PR. Nobody is complaining about your PR #201 which remains valid. |
@astirpe ok, I will check |
Commit b5d1a7a should fix the issue mentioned in #207 (comment) |
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.
Minor change
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.
Review completed. Good changes. 👍
But please, answer my question above
@alexey-pelykh could you review this? |
Commit [FIX] Allow to delete all lines + better tab sync contains a fix for issue #198. The fix is better than the one proposed in #203. The proposed solution consists in splitting and fixing the onchange method of the date fields and the As a consequence of fixing the onchange methods, another wrong behavior is fixed: when deleting lines in the Details tab, the Summary tab is automatically updated (it was not updated before this commit). Supersedes #203. |
Commit 455d280 fixes the onchange of field employee_id (fixes #209). The proposed fix restores the state 'New' for the timesheet sheet, like it was in standard Odoo 10.0 (see line). Restoring the state 'New' is necessary to impede the onchange of |
Squashed and rebased |
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.
Did the code review, yet no functional test yet
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.
Code LGTM, yet I'm already scared how this going to be ported to v12
@astirpe please squash the code review commit as fixup into other commit |
@alexey-pelykh I can do the porting to V12, I think I'm now confident enough with this module. |
@astirpe That would be much appreciated! |
[IMP] Fix amount calculation issues [IMP] Better warning message when onchange_unit_amount() fails [IMP] Performance [FIX] Allow to delete all lines + better tab sync [IMP] Coverage [REM] Remove useless lines of code [IMP] Code simplification [IMP] Code review
[FIX] Make employee_id readonly when timesheet sheet is approved [FIX] Onchange employee_id
Porting to V12: #211 |
I need also 412a801 to make customization easier |
And 4dc6093 makes the list view more readable. |
Commit b2c5b30 simplifies the code and I think also with performance benefits |
Commit 66a2455 fixes the following issue.
Company is not updated: it stays YourCompany (not ok). |
@astirpe do you plan other changes in this PR? |
@alexey-pelykh No. I would be happy to stop it here. 😉 |
@nikul-serpentcs please re-review |
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.
Only Code review LGTM 👍
This PR has the |
@pedrobaeza please take a look at this PR |
Merging blindly on my side due to previous approvals. |
This PR fixes the amount calculation issues (see #206) regarding the decrease of the amount of hours from the summary tab.
The idea is that decreasing the amount from the summary tab should not directly decrease the amounts of time for existing projects and/or tasks, to avoid potential loose of relevant information. In case it's needed, it's up to the end user to manually adjust the amounts or merge lines in the details tab.
This is basically achieved by removing the
def _diff_amount_timesheets()
method.The proposed solution also causes a code reduction (simplified code) including the following:
count_timesheets
fielddef onchange_unit_amount()
sheet.timesheet_ids
in place ofself.env['account.analytic.line'].search()
This PR implicitly allows negative amounts: two lines are removed from
def onchange_unit_amount()
, the same way as it is done in #201.This PR also fixes method
def _default_employee()
in a multicompany environment, filtering the default employee by company.Fixes #198
Fixes #209