-
-
Notifications
You must be signed in to change notification settings - Fork 700
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
[14.0] [FIX] account_invoice_triple_discount: for in invoice_line_ids if exists, else on line_ids #1605
[14.0] [FIX] account_invoice_triple_discount: for in invoice_line_ids if exists, else on line_ids #1605
Conversation
@OCA/accounting-maintainers this looks urgent to me |
@SirAionTech what do you think of this one? |
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 review LGTM
chore: please adjust the commit message following the guidelines: https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#commit-message
suggestion (non-blocking): since this is a rather intricate and delicate matter (had to read multiple issues in multiple languages to understand the context), I think adding a test would be helpful in avoiding regressions and it would implicitly also explain the reason behind the change. If not a test, at least a comment.
chore: once approved, please FW to v15 and 16!
@ferran-S73 fyi |
digits = self.invoice_line_ids._fields["price_unit"]._digits | ||
self.invoice_line_ids._fields["price_unit"]._digits = (16, 16) | ||
for line in self.invoice_line_ids: | ||
lines = self.invoice_line_ids or self.line_ids |
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.
I think it would be better to check if it is_invoice
instead.
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.
Working on the broken test, is_invoice returns True but without invoice_line_ids. So in this case it will not fix the test
91ff4d1
to
965b57d
Compare
I think there should be a test in this module that explains what this change is fixing and ensures that there are no regressions in the future. If this module ain't broken, don't fix it. |
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.
Functional review is ok.
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.
Thanks
(rif OCA/l10n-italy#3681 (comment))
Why? |
Because in my opinion, a module should test its own behavior. If triple discount works good for invoices, why is it breaking sales? I see a few options:
|
@pedrobaeza can I ask your input here? the urgency is due to sale-workflow 14 tests currently failing |
This makes sense. |
We tried adding a test from You can found it in the old PR: https://github.com/OCA/account-invoicing/pull/1442/files#diff-3c2a0c335b3658f70e6cc646d2f82097e866dbcd7267a0b3497df142d9cd2392R184 |
This patch sounds weird, but let's continue for unblocking the CI: /ocabot merge patch |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at fb8e62f. Thanks a lot for contributing to OCA. ❤️ |
…ts, else on line_ids
fix #1592 (comment)