Skip to content
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][FIX] account_reconcile_oca : Wrong amount currency compute in case of change in liquidity line #787

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

florian-dacosta
Copy link
Contributor

@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)

  1. Create a bank journal with EURO currency

  2. Create a statement line in this journal with amount = 100 euros
    image

  3. Click on the liquidity line and update the partner
    image

=> 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.

@OCA-git-bot
Copy link
Contributor

Hi @etobella,
some modules you are maintaining are being modified, check this out!

Copy link
Member

@victoralmau victoralmau left a 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.

@florian-dacosta
Copy link
Contributor Author

When updating (onchange) the manual_amount_in_currency field, the manual_amount field is not updated (the same in reverse).

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.
I believe there still are a lot of issues linked to multi-currency if the user start to edit some amount or amount currency manually.
I think this part require quite some refactore, and also to have detailed use-cases we want to solve for a start.
For now we can edit both amount and amount in currency, and modyfing one sometimes impact the other, or not....

In anyway, I think we can deal with these issues in another PR, if someone have the courage to dig into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants