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][IMP] Add config setting to always use product analytic #623

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

Conversation

victor-champonnois
Copy link
Member

@victor-champonnois victor-champonnois commented Jan 31, 2024

This module adds an option to force the use of the product analytic account for service products invoiced on timesheets.

Use case:
We have a service product, invoiced on timesheet and that triggers the creation of a project when a SO is confirmed. Note that doing this, an analytic account is created and linked to the SO (module sale_project)
An income analytic account is defined on this product. We want this analytic account to be in the analytic distribution of the invoice lines that are created from the SO.
Now, this is not possible. When creating an invoice, the analytic distribution on the invoice lines is the SO analytic account.
This option forces the use of the product analytic account on the invoice line instead.

I am not sure if this is the right place to make this change, since this module product_analytic does not depend on sale_project. Tell me if you think of a better place for this code.

Forward porting of #613

@victor-champonnois
Copy link
Member Author

@robinkeunen

@victor-champonnois victor-champonnois changed the title [IMP] Add config setting to always use product analytic [16.0][IMP] Add config setting to always use product analytic Jan 31, 2024
Copy link

@robinkeunen robinkeunen left a comment

Choose a reason for hiding this comment

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

Code looks good and thx for the unit test.

I think it could be useful to document the problematic use case (documented in the PR description) in the commit message.

Use case:
We have a service product, invoiced on timesheet and that triggers the creation of a project when a SO is confirmed. Note that doing this, an analytic account is created and linked to the SO (module sale_project)
An income analytic account is defined on this product. We want this analytic account to be in the analytic distribution of the invoice lines that are created from the SO.
Now, this is not possible. When creating an invoice, the analytic distribution on the invoice lines is the SO analytic account.
This option forces the use of the product analytic account on the invoice line instead.
@victor-champonnois
Copy link
Member Author

@robinkeunen use case added in the commit message

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.

None yet

2 participants