smna-odoo db0d943b0f [FIX] stock: add SM without scheduled date
If a user adds a new SM to a picking without any scheduled date,
traceback will appear

To reproduce the issue:
1.  create a new picking and remove the scheduled_date.
2.  try to add a new storable product in move lines.

Error: A traceback appears: "TypeError: '>' not supported between
instances of 'datetime.datetime' and 'bool'"

On the picking form, the default SM date is the scheduled date of the
picking:
https://github.com/odoo/odoo/blob/2c3f53d5a0380e7de27977f56f20307ff2bccabf/addons/stock/views/stock_picking_views.xml#L358
Therefore, in the above use case, when triggering the onchange/compute
methods, the field `date` of the SM will not be defined. At some
point, we need to get the forecasted quantities of the SM product
(see the method updated by this commit) and, to do so, we compare
the SM date with `now`. Since this date is `False`, it will lead to the
above traceback

sentry-3979281197

closes odoo/odoo#124352

X-original-commit: e6179a5147a33dc53ce4ffbdace2585f13f18a14
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-06-09 09:35:02 +02:00
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%