-
-
Notifications
You must be signed in to change notification settings - Fork 257
[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
base: 16.0
Are you sure you want to change the base?
[16.0][FIX] account_cutoff_accrual_order_base: product analytic #341
Conversation
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'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? |
@sbidoul I modified |
1227d3c
to
d04e3f5
Compare
TODO: add test |
91d332a
to
29d5222
Compare
done |
account_cutoff_accrual_purchase_product_analytic/tests/__init__.py
Outdated
Show resolved
Hide resolved
8d65826
to
9583895
Compare
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
add test glue module
9583895
to
61833cf
Compare
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