You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Open a brand new runboat for 16.0
Create a sale order with some stockable product (let's say FURN_6666)
Set the delivery date on the line
Confirm the sale order
Remove the delivery date
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.
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 :
To Reproduce
Affected versions: 16.0
Steps to reproduce the behavior:
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
The text was updated successfully, but these errors were encountered: