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][FIX] account_cutoff_accrual_sale : Fixes for SO invoiced on order + [ADD] support for down payment #326

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

Conversation

jbaudoux
Copy link
Contributor

@jbaudoux jbaudoux commented Feb 12, 2025

I added pleeeeenty of tests !

Covering:

  • normal service on order : should be invoiced when SO is confirmed
  • shipping service on order : should be invoiced when first stock delivery occurs (that's a specificity of delivery module https://github.com/odoo/odoo/blob/16.0/addons/delivery/models/sale_order.py#L155)
  • stock product on order : should be invoiced when delivered (invoicing policy doesn't matter here, accrual is based on stock valuation change, i.e. the effective stock delivery)

cc @rousseldenis @lmignon @sbidoul

Also fixed account_cutoff_accrual_order_base that was updating stock in the test while not depending on stock module. Code moved to modules depending on this one and stock

Edit: I also added support for downpayment

@jbaudoux jbaudoux force-pushed the 16-fix-account_cutoff_policy_sale branch 2 times, most recently from 5c23391 to 2f87938 Compare February 12, 2025 20:38
Validate service invoice to only test stock products
Properly compute accruals when the invoice policy is on order.
For service, consider it should be invoiced once confirmed.
For stock, make accruals if the invoice and delivered quantity are not
on the same period.
@jbaudoux jbaudoux force-pushed the 16-fix-account_cutoff_policy_sale branch 2 times, most recently from d408392 to 46f2288 Compare February 12, 2025 21:43
Module does not depend on stock
Fix account_cutoff_accrual_order_base that does not depend on stock. Code moved here
Fix account_cutoff_accrual_order_base that does not depend on stock. Code moved here
@jbaudoux jbaudoux force-pushed the 16-fix-account_cutoff_policy_sale branch from 46f2288 to 2816a86 Compare February 12, 2025 21:47
@jbaudoux jbaudoux marked this pull request as ready for review February 12, 2025 21:47
@jbaudoux jbaudoux changed the title [16.0][FIX] account_cutoff_accrual_sale : Fixes for SO invoiced on order [16.0][FIX] account_cutoff_accrual_sale : Fixes for SO invoiced on order + [ADD] support for down payment Feb 13, 2025
self.ensure_one()
if self.product_id.invoice_policy == "order":
date = self.order_id.date_order
return date.date()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to use right TZ

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.

1 participant