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] sale_order_line_date : removing the date after sale has been confirmed raises TypeError #3363

Open
metaminux opened this issue Oct 16, 2024 · 0 comments · May be fixed by #3364
Open
Labels

Comments

@metaminux
Copy link

Module

sale_order_line_date

Describe the bug

When updating the Delivery date (commitment_date field) on a sale order line, this module updates the stock moves related to the line.
During the computation of new dates for stock moves, the delta with previous date is used in module stock to avoid recomputation of all delays.
Now, if we just remove the commitment date, the delta is trying to compare previous date with nothing... which leads to :

TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'NoneType'

To Reproduce

Affected versions: 16.0

Steps to reproduce the behavior:

  1. Open a brand new runboat for 16.0
  2. Create a sale order with some stockable product (let's say FURN_6666)
  3. Set the delivery date on the line
  4. Confirm the sale order
  5. Remove the delivery date
  6. Save the order

Expected behavior
This shouldn't raise a TypeError.
All dates should be updated in stock moves and ideally be the same as when the order is first confirmed with no delivery date set.

Additional context
By default, when no delivery date is set, procurements are created with date_deadline :
https://github.com/odoo/odoo/blob/c991ad65821e2022868b9bb8b1e899795ceba0a7/addons/sale_stock/models/sale_order_line.py#L259

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