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

[18.0][MIG] account_analytic_spread_by_tag: Migration to 18.0 #712

Open
wants to merge 7 commits into
base: 18.0
Choose a base branch
from

Conversation

peluko00
Copy link
Contributor

@peluko00 peluko00 commented Nov 20, 2024

@peluko00 peluko00 changed the title [18.0][MIG] account analytic_spread_by_tag: Migration to 18.0 [18.0][MIG] account_analytic_spread_by_tag: Migration to 18.0 Nov 20, 2024
@peluko00 peluko00 mentioned this pull request Nov 20, 2024
10 tasks
@miquelalzanillas
Copy link
Contributor

Hi @peluko00 ,

Please rebase and remove test-requirements.txt as the dependency has been merged.

Thanks.

@peluko00 peluko00 force-pushed the 18.0-mig-account_analytic_spread_by_tag branch from ae2e449 to d8cfa29 Compare November 21, 2024 10:33
@peluko00
Copy link
Contributor Author

Hi @peluko00 ,

Please rebase and remove test-requirements.txt as the dependency has been merged.

Thanks.

Done!

{
"name": default_name,
"date": self.date,
"account_id": aac.id,
Copy link
Contributor

@BernatObrador BernatObrador Nov 21, 2024

Choose a reason for hiding this comment

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

This approach doesn't work correctly because it always assigns the analytic account to the project plan defined in the settings:

self.env["ir.config_parameter"].sudo().get_param("analytic.project_plan", 0) 

This retrieves the plan that should be in the account_id.

You need to determine whether the plan belongs in the account_id or in one of the dynamic x_plan{id}_id fields. These x_plan fields are autogenerated based on the analytic plans you have, identified by their ID.

To fix this, you can do the following:

Suggested change
"account_id": aac.id,
aac.root_plan_id._column_name(): aac.id,

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe @miquelalzanillas can review the changes and then open a FIX pr for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review @BernatObrador, @miquelalzanillas what do you think about it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @peluko00 ,

@BernatObrador is right.

Analytic plan definition is needed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks! Can you review again @miquelalzanillas @BernatObrador please?

@peluko00 peluko00 force-pushed the 18.0-mig-account_analytic_spread_by_tag branch from d8cfa29 to a05b7e2 Compare November 28, 2024 08:03
@peluko00 peluko00 force-pushed the 18.0-mig-account_analytic_spread_by_tag branch from a05b7e2 to 67e842e Compare November 28, 2024 10:15
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.

5 participants