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

[14.0][FIX] account_reconciliation_widget: Avoid unbalanced foreign currency reconciliations + exclude own amls in reconcile models propositions #603

Conversation

pedrobaeza
Copy link
Member

@pedrobaeza pedrobaeza commented Oct 20, 2023

When having a statement line in a foreign currency, each resulting journal item computes the debit/credit amount from the foreign currency rate, and then rounding the result to company currency digits.

There's a chance in this process that the journal entry final balance is not 0 summing the rounded balances in company currency.

For fixing this, there can be several strategies, like creating an extra journal item for the difference, but I have opted for removing the difference in the latest counterpart aml, so no extra noise and no need of account decision algorithm for this extra move.

As currency amounts are correct and are the ones used in reconciliation, there won't be any problem adjusting this amount.

@Tecnativa TT45568

@pedrobaeza pedrobaeza added this to the 14.0 milestone Oct 20, 2023
…y reconciliations

When having a statement line in a foreign currency, each resulting
journal item computes the debit/credit amount from the foreign currency
rate, and then rounding the result to company currency digits.

There's a chance in this process that the journal entry final balance
is not 0 summing the rounded balances in company currency.

For fixing this, there can be several strategies, like creating an
extra journal item for the difference, but I have opted for removing
the difference in the latest counterpart aml, so no extra noise and
no need of account decision algorithm for this extra move.

As currency amounts are correct and are the ones used in reconciliation,
there won't be any problem adjusting this amount.

TT45568
@pedrobaeza pedrobaeza force-pushed the 14.0-fix-account_reconciliation_widget-foreign_currency_unbalanced branch from 8c9e613 to 2a1171d Compare October 21, 2023 16:44
When getting propositions from the reconcile models, we should
explicitly exclude the amls of the bank statement lines.

If not, we can get a situation where the journal item of the bank
statement line is proposed to itself.

TT45568
@pedrobaeza
Copy link
Member Author

Added an extra commit for a discovered situation testing the other patch: the journal item of a bank statement line can be proposed to itself in the reconciliation widget. This patch also requires a patch in Odoo: odoo/odoo#139419

@pedrobaeza pedrobaeza changed the title [14.0][FIX] account_reconciliation_widget: Avoid unbalanced foreign currency reconciliations [14.0][FIX] account_reconciliation_widget: Avoid unbalanced foreign currency reconciliations + exclude own amls in reconcile models propositions Oct 22, 2023
@pedrobaeza pedrobaeza requested review from victoralmau and chienandalu and removed request for sergio-teruel and carlosdauden November 3, 2023 19:43
@pedrobaeza
Copy link
Member Author

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 14.0-ocabot-merge-pr-603-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 2c946e8 into OCA:14.0 Nov 6, 2023
5 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 2548da4. Thanks a lot for contributing to OCA. ❤️

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

Successfully merging this pull request may close these issues.

4 participants