-
-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[16][FIX] account_reconcile_oca : Wrong amount currency compute in case of change in liquidity line #787
[16][FIX] account_reconcile_oca : Wrong amount currency compute in case of change in liquidity line #787
Conversation
Hi @etobella, |
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.
In runboat solves the explained error BUT.
When updating (onchange) the manual_amount_in_currency
field, the manual_amount
field is not updated (the same in reverse).
I think @etobella will be able to provide more context to all this.
This is the case with and without the PR I think. I am well aware of such problems, but this is not a problem I am trying to solve. In anyway, I think we can deal with these issues in another PR, if someone have the courage to dig into this! |
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.
/ocabot merge patch
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 484fdf6. Thanks a lot for contributing to OCA. ❤️ |
Please forward-port it to 17 |
@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.