-
Notifications
You must be signed in to change notification settings - Fork 0
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 reconcile oca currency fixes v4 #4
16 reconcile oca currency fixes v4 #4
Conversation
…wanted currency conversion
…ount If currency amount is not 0, the suspense line will have wrong amount
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 16.0-fix-mcurr #4 +/- ##
=================================================
Coverage ? 85.87%
=================================================
Files ? 77
Lines ? 3093
Branches ? 441
=================================================
Hits ? 2656
Misses ? 325
Partials ? 112 ☔ View full report in Codecov by Sentry. |
@@ -230,7 +229,7 @@ def _onchange_add_account_move_line_id(self): | |||
self.add_account_move_line_id, | |||
"other", | |||
True, | |||
max_amount=pending_amount, | |||
max_amount=currency.round(pending_amount), |
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.
Without it, we then compare this amount with a rounded amount. (in my case something like 20.0 > 19.99999999. (here : https://github.com/OCA/account-reconcile/blob/16.0/account_reconcile_oca/models/account_reconcile_abstract.py#L51)
This leading to an unwanted conversion of the currency_amount (https://github.com/OCA/account-reconcile/blob/16.0/account_reconcile_oca/models/account_reconcile_abstract.py#L57)
"line_currency_id": self.company_id.currency_id.id, | ||
"currency_amount": amount, | ||
"line_currency_id": currency.id, | ||
"currency_amount": 0, |
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.
The exchange rate gain/loss line should have the same currency of the line is is linked to and the currency_amount should be 0, else, it is taken into account in the suspense line recomputation leading to very weird result (taken into account here I think : https://github.com/OCA/account-reconcile/blob/16.0/account_reconcile_oca/models/account_bank_statement_line.py#L242)
@etobella Could you merge it please ? |
Hello @etobella
It's been a while... One more PR to try to fix some multi-currency case
The case it fixes is 1 paymant in a foreign currency journal to reconcile with 2 invoices in the same foreign currency of the journal.