8000 [16.0][FIX] account_cutoff_accrual_order_base: product analytic by jbaudoux · Pull Request #341 · OCA/account-closing · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[16.0][FIX] account_cutoff_accrual_order_base: product analytic #341

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

Open
wants to merge 6 commits into
base: 16.0
Choose a base branch
from

Conversation

jbaudoux
Copy link
Contributor
@jbaudoux jbaudoux commented Apr 11, 2025

Keep product on each move line.
Set the move type to allow product_analytic to compute the right analytic account.

Depends on:

This change will require to modify the accrual journal to make it a sales or purchase journal if it was a miscellaneous journal. This is required to map to the right income or expense analytic account.

cc @sbidoul

@sbidoul
Copy link
Member
sbidoul commented Apr 15, 2025

This change will require to modify the accrual journal to make it a sales or purchase journal if it was a miscellaneous journal

This is surprising and, I think, problematic. Why is this necessary?

@jbaudoux
Copy link
Contributor Author

This change will require to modify the accrual journal to make it a sales or purchase journal if it was a miscellaneous journal

This is surprising and, I think, problematic. Why is this necessary?

@sbidoul Yes, that's why I wanted your feedback. This is due to the fact that there is an income and expense analytic account on the product and to apply the right one, the account move must belong to an sales or purchase journal. See https://github.com/OCA/account-analytic/blob/16.0/product_analytic/models/account_move.py#L46
I don't see that as an issue. Do you?
In odoo standard, when you accrue from the PO, it's making an entry on a "entry" journal. So won't work neither.
Do you see anot 8000 her approach to make it compatible with "entry" journals ?

@sbidoul
Copy link
Member
sbidoul commented Apr 15, 2025

I'm afraid having accrual moves on sale/purchase journals will create problems down the line. For instance in tax reporting it's likely that the journal type is involved.

When we do accruals from invoices, we use the same analytic distribution as the original moves. So maybe we should compute the analytic distribution in the accrual move creation code, using the same logic that computes it when creating an invoice from SO/PO?

@jbaudoux
Copy link
Contributor Author

@sbidoul I modified product_analytic to allow to collect the right distribution without having to change the journal. OCA/account-analytic#768
I'll adapt this PR

@jbaudoux jbaudoux force-pushed the 16-fix-account_cutoff_move_type_product branch from 1227d3c to d04e3f5 Compare April 15, 2025 13:04
@jbaudoux
Copy link
Contributor Author

TODO: add test

@jbaudoux jbaudoux force-pushed the 16-fix-account_cutoff_move_type_product branch 5 times, most recently from 91d332a to 29d5222 Compare April 15, 2025 21:31
@jbaudoux
Copy link
Contributor Author

TODO: add test

done

@jbaudoux jbaudoux force-pushed the 16-fix-account_cutoff_move_type_product branch 2 times, most recently from 8d65826 to 9583895 Compare April 18, 2025 12:02
Do not set analytic distribution to False in move creation to allow standard computation
Keep product on each move line.
Set the move type to allow product_analytic to compute the right analytic account
@jbaudoux jbaudoux force-pushed the 16-fix-account_cutoff_move_type_product branch from 9583895 to 61833cf Compare April 18, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0