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.0][FIX] account_reconcile_oca: Fixed exchange move lines never input analytic #772

Closed
wants to merge 1 commit into from

Conversation

BernatObrador
Copy link
Contributor

This fix resolves an issue where analytic distribution was not generated for exchange difference lines. This issue caused conflicts with the analytic policy, as exchange accounts that required analytics would prevent reconciliation when these lines were created. The fix ensures that analytics are correctly applied.

cc https://github.com/APSL 165008

@miquelalzanillas @lbarry-apsl @mpascuall @peluko00 @javierobcn @ppyczko please review

@OCA-git-bot
Copy link
Contributor

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

@BernatObrador BernatObrador force-pushed the 16.0-fix-account_reconcile_oca branch from aca88be to 6eb67da Compare December 19, 2024 10:53
…alytic

This fix solves a bug when trying to generate analytic from an exchange difference line, wich will never generate analytic
@BernatObrador BernatObrador force-pushed the 16.0-fix-account_reconcile_oca branch from 6eb67da to 9b9e327 Compare December 19, 2024 11:13
Copy link

@mpascuall mpascuall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review and LGTM. @etobella What do you think about it?

@pedrobaeza pedrobaeza added this to the 16.0 milestone Dec 19, 2024
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bunch of code for a fix like that seems a bad patch, and more involving SQL code, so you should look for other way to solve the problem. Anyway, the multi-currency stuff seems to be solved at #694

Did you try it?

@BernatObrador
Copy link
Contributor Author

Hi @pedrobaeza, just taking a look at the PR. It solves some bugs related to multi-currency, but it doesn't fix anything regarding analytics.

This PR fixes the issue where multi-currency exchange lines could not allocate analytics. Without these changes, these lines would never pick up any type of analytics.

There are still more problems with this, for example, if you have the account_analytic_required module and the policy for exchange difference accounts is set to "always," you'll never be able to reconcile, as it will always warn you that the account is not allocating analytics.

I could review if there's a better way to handle it. The issue is that, as it is currently treated, it's necessary to make a query to access the reconcile_data from the account.bank.statement.line, which is where the analytics data for that line is stored.

@pedrobaeza
Copy link
Member

But SQL should never be used, and as said, it seems weird that such a patch requires so many lines of code.

@BernatObrador
Copy link
Contributor Author

@pedrobaeza After reviewing the issue again, I realized it can be resolved by using distribution models, so this fix is unnecessary. I'm closing the PR. Thanks for your feedback!

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.

4 participants