-
-
Notifications
You must be signed in to change notification settings - Fork 414
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_payment_term_discount: Difference in rounding #724
base: 14.0
Are you sure you want to change the base?
Conversation
Hi @bodedra, |
@majouda Thanks for your contribution. Would you add screenshot or example before and after this PR changes, please? |
@@ -45,7 +45,7 @@ def onchange_payment_amount(self): | |||
payment_date = fields.Date.from_string(self.payment_date) | |||
discount_amt = self.invoice_id.discount_amt | |||
|
|||
payment_difference = self.payment_difference | |||
payment_difference = abs(round(self.payment_difference, 2)) |
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 would be better to use float_round
with the invoice_id.currency_id
's precision, ultimately the same result for most but it would save headaches for any currency that doesn't use 2 decimal places
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 @hildickethan-S73 I made some changes according to your comment.
Can you please check again?
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.
LGTM 👍
This PR has the |
In the context of this module's application, we encountered a specific issue involving:
Although there is no rounding in _compute_payment_difference() of account module and this module performs rounding in _compute_discount_amt().
This discrepancy in rounding can lead to different comparison results.
This commit aims to rectify the inconsistency in rounding between these two fields, ensuring accurate comparisons.