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
[15.0][FIX] sale_timesheet_rounded: avoid recomputing rounded amounts when not needed #590
base: 15.0
Are you sure you want to change the base?
[15.0][FIX] sale_timesheet_rounded: avoid recomputing rounded amounts when not needed #590
Conversation
a6c43eb
to
c7733aa
Compare
51d9598
to
8ab89bf
Compare
Hi @StephaneMangin thank you for your contribution! Could you please rebase and check the tests again? |
67e584a
to
b673910
Compare
b2e191d
to
26a8b42
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.
Can you please:
- rewrite the 1st commit msg to include the explanation given in the description of the PR? (TIP: if you do it before, you get the description for free on the PR 😉 ). As you rewrite the commit pls drop the odoo version.
- can you explain what is the conflict in tests? We should try to avoid rebels modules as far as possible
@@ -14,7 +14,8 @@ odoo_test_flavor: Both | |||
odoo_version: 15.0 | |||
org_name: Odoo Community Association (OCA) | |||
org_slug: OCA | |||
rebel_module_groups: [] | |||
rebel_module_groups: | |||
- sale_timesheet_rounded |
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.
what is the conflict in particular?
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.
Hello, I don't remember the exact fault, but AFAIR this was a good idea. Is this a blocking 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.
It is, if not justified. The issue is that when we increase the number of tests suites that will run.
So, what is the conflict? Can't we find a better way to prevent that? Eg: disable partly of fully this feature when not needed?
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.
@sonhd91 worked on a fix for that in the context of the migration of this module to 17.0; he will backport it and follow-up here
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.
Hello @simahawk, here is the fix, please check it out
@api.depends("timesheet_invoice_id.state") | ||
def _compute_project_id(self): | ||
field_rounded = self._fields["unit_amount_rounded"] | ||
if self._context.get("timesheet_no_recompute", False): |
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.
if self._context.get("timesheet_no_recompute", False): | |
if self.env.context.get("timesheet_no_recompute", False): |
_inherit = "sale.advance.payment.inv" | ||
|
||
def create_invoices(self): | ||
"""Override method from sale/wizard/sale_make_invoice_advance.py |
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 is a comment
Co-authored-by: Nils Hamerlinck <nilshamerlinck@users.noreply.github.com>
Superseed #585
This is causing the field to be set as computed, but there is no real change
We don't want to compute the field in these cases:
This is causing the field aal.project_id to be considered as computed, but it is not.
It will then call the @api.depends('project_id',...) on the computation of the unit_amount_rounded (even if there was no change on the value of aal.project_id.