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][ADD] account cutoff accrual on order #271

Merged

Conversation

jbaudoux
Copy link
Contributor

@jbaudoux jbaudoux commented Oct 25, 2023

Port and refactor #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

@OCA-git-bot
Copy link
Contributor

Hi @alexis-via,
some modules you are maintaining are being modified, check this out!

@jbaudoux jbaudoux force-pushed the 16.0-fix-mig-account_cutoff_picking_ref branch 6 times, most recently from a1c4ffe to 8fe0a61 Compare October 25, 2023 16:36
@jbaudoux jbaudoux marked this pull request as ready for review October 26, 2023 08:54
@jbaudoux jbaudoux force-pushed the 16.0-fix-mig-account_cutoff_picking_ref branch 4 times, most recently from 867b8b0 to 335c613 Compare October 26, 2023 12:41
@jbaudoux jbaudoux force-pushed the 16.0-fix-mig-account_cutoff_picking_ref branch from b6c24af to 335c613 Compare October 26, 2023 13:05
@jbaudoux jbaudoux force-pushed the 16.0-fix-mig-account_cutoff_picking_ref branch 6 times, most recently from 9664605 to c2710f7 Compare October 26, 2023 15:38
@jbaudoux jbaudoux force-pushed the 16.0-fix-mig-account_cutoff_picking_ref branch 6 times, most recently from 014fa2b to 645c9e6 Compare November 8, 2023 08:54
@jbaudoux
Copy link
Contributor Author

jbaudoux commented Nov 8, 2023

@alexis-via Added dependencies on sale/purchase_force_invoiced to handle exclusion. I dropped my boolean in favor of that force_invoiced

@jbaudoux jbaudoux force-pushed the 16.0-fix-mig-account_cutoff_picking_ref branch from 645c9e6 to 896e3e0 Compare November 8, 2023 09:04
@jbaudoux jbaudoux force-pushed the 16.0-fix-mig-account_cutoff_picking_ref branch from ff6d5ad to 04f79c0 Compare August 7, 2024 12:58
@jbaudoux
Copy link
Contributor Author

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.

@jbaudoux
Copy link
Contributor Author

@alexis-via Have you had the chance to test this PR in comparison to your previous implementation ? Can it get merged ?

@jbaudoux jbaudoux force-pushed the 16.0-fix-mig-account_cutoff_picking_ref branch from 6625cba to f9375a8 Compare September 30, 2024 14:47
@adrienpeiffer
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-271-by-adrienpeiffer-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Oct 10, 2024
Signed-off-by adrienpeiffer
@OCA-git-bot
Copy link
Contributor

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). 🤖

@OCA-git-bot
Copy link
Contributor

@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`.   

@jbaudoux jbaudoux force-pushed the 16.0-fix-mig-account_cutoff_picking_ref branch from f9375a8 to 1a2e267 Compare October 10, 2024 15:48
@jbaudoux
Copy link
Contributor Author

@adrienpeiffer I added the missing readmes and squashed the fix commits

@adrienpeiffer
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-271-by-adrienpeiffer-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 4285802 into OCA:16.0 Oct 18, 2024
9 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 0df36e7. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants