odoo/odoo#196709

Created by fw-bot
Merged at e164a93d784638e977d09ba3980faab083247365

Statuses:

label
odoo-dev:master-saas-18.1-sentry-6250719075-typeerror-mrp-production-overview-alsh-414155-fw
head
07727fa29da878d064bbca10de79b0675eb47c3c
merged
8 months ago by Bugfix, Altaf Shaik (alsh)
odoo/odoo
saas-18.1 #196566
saas-18.2
saas-18.3
saas-18.4
19.0
master #196709

[FW][FIX] mrp: fix traceback when clicking overview of a MO

Currently, a traceback appears when the user opens 'Overview' of a canceled 'Manufacturing Order'.

To reproduce this issue:

1) Install MRP
2) Create a new Manufacturing Order record
3) Give a product with a Quantity more than the On hand quantity of that product
4) Add a product in the Component with the To consume value more than
the On Hand quantity of that product
5) Click on the Cancel button then Click the Overview button

Error:-

TypeError: can't compare datetime.datetime to datetime.date

This error is occurring because of the recent changes from the below.

#184928/files#diff-a889e57d7462d595b2a3e056dc37237c9ab73d43c42458b52288733ae84aca73L609-R609

Initially, it was datetime.datetime, But recently it was changed to the datetime.date.
This leads to the above traceback when a comparison is made between
datetime.datetime and datetime.date from the below lines

https://github.com/odoo/odoo/blob/cb96e9133590e07880f0e98b21486d578caecd3a/addons/mrp/report/mrp_report_mo_overview.py#L583

sentry-6250719075

Forward-Port-Of: #196566