account-closing
account-closing copied to clipboard
[16.0][ADD] account cutoff accrual on order
Port and refactor https://github.com/OCA/account-closing/pull/73
Generate cutoff accruals by analyzing order lines invoiced & delivered quantity (or ordered quantity for sales with invoice policy on order).
Several modules are provided:
-
account_cutoff_accrual_order_base
: Base module to analyze any type of order lines -
account_cutoff_accrual_order_stock_base
: Base module to analyze order lines delivered by stock moves -
account_cutoff_accrual_sale
: analyze sales order lines to accrue what must be invoiced. Generates accrued revenue, i.e. invoice to establish -
account_cutoff_accrual_purchase
: analyze purchase order lines to accrue what must be invoiced. Generates accrued expense, i.e. invoice to receive -
account_cutoff_accrual_sale_stock
: analyze sales order lines to accrue what must be delivered. Generates accrued prepaid revenue, i.e. goods to deliver -
account_cutoff_accrual_purchase_stock
: analyze purchase order lines to accrue what must be received. Generates accrued prepaid expense, i.e. goods to receive
The modules allow to process a large amount of data in a reasonable amount of time. To decrease the amount of stock moves & invoices to analyze a cron pre-generates the cutoff entries at the end of the period. Nevertheless, it is always possible to regenerate entries at any time (but the more stock moves & invoices to analyze are, the more time it will take). Any invoice posted after the cutoff is generated will alter the corresponding cut-off entries. Once the cut-off is posted is accounting, you cannot anymore alter the entries.
Note: Those modules covers the feature provided by stock_cutoff_picking
but in a more generic and efficient way. Instead of analyzing all pickings & invoices inside a given interval, only pickings and invoices generated after the cutoff date are analyzed,
The limit in time in the past is then now disabled.
Accrual on order flagged as force_invoiced is disabled.
Road-map: The generic approach of the modules allows to extend the features to generate accrual on service SO / PO with project tasks
cc @alexis-via @florian-dacosta @rousseldenis
Hi @alexis-via, some modules you are maintaining are being modified, check this out!
@alexis-via Added dependencies on sale/purchase_force_invoiced to handle exclusion. I dropped my boolean in favor of that force_invoiced
@alexis-via Everything we discussed as been done (that I remember as you forgot to post your review). Can you redo a final review?
Fixed cron job method
@alexis-via This deserves a little review. Thanks
I fixed the case of sale delivery line (service) added after SO confirmation and after cutoff date.
I added the use case where a SO having only the delivery line (shipping cost) to invoice among the SO lines is not considered as invoiceable.
@alexis-via Have you had the chance to test this PR in comparison to your previous implementation ? Can it get merged ?
/ocabot merge nobump
On my way to merge this fine PR! Prepared branch 16.0-ocabot-merge-pr-271-by-adrienpeiffer-bump-nobump, awaiting test results.
This PR has the approved
label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖
@adrienpeiffer The merge process could not be finalized, because command twine check odoo_addon_account_cutoff_accrual_purchase_stock-16.0.1.0.0.10-py3-none-any.whl
failed with output:
Checking
odoo_addon_account_cutoff_accrual_purchase_stock-16.0.1.0.0.10-py3-none-any.whl:[31mFAILED[0m
[31mERROR [0m `long_description` has syntax errors in markup and would not be
rendered on PyPI.
No content rendered from RST source.
[33mWARNING [0m `long_description_content_type` missing. defaulting to `text/x-rst`.
@adrienpeiffer I added the missing readmes and squashed the fix commits