[16][FIX] account_reconcile_oca : Wrong amount currency compute in case of change in liquidity line #787
+6
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@etobella There is a regression in multi-currency management since the following commit was merged : f0ae2f0
I don't know the use case for which this code was added, but you can reproduce the issue it creates easily :
On demo database with account_reconcile_oca (company currency is USD)
Create a bank journal with EURO currency
Create a statement line in this journal with amount = 100 euros
Click on the liquidity line and update the partner
=> The USD amount is copied in the amount in currency.
This is because here : https://github.com/OCA/account-reconcile/blob/16.0/account_reconcile_oca/models/account_bank_statement_line.py#L448
The source and destination currency is EURO and the amount converted is USD !
But even if this was fine, I don't see any reason to update amounts for the liquidity line... It could lead to erros because the rate at this time may be different than the one used at the time of the creation of the statement line.
There may be a better fix, but not knowing exactly the purpose of this part, I prefer to leave it.
By the way, I am always surprised that it is possible to modifiy the manual_amount/manual_amount_currency of the liquidity line, is there any reason or could we put it as readonly to avoid user mistakes ?
I have completed a test to show the failing case.