Skip to Content
Menu
This question has been flagged
1 Reply
1628 Views

Hello,

I am running the Mediocre DHX Gantt in Odoo version 12 and I have encountered the following error:  

self.date_start = datetime.combine(self.project_id.date_start, datetime.time.min)
TypeError: combine() argument 1 must be datetime.date, not bool
Can anyone tell me how to correct the python script to prevent the data type mismatch?

Thank you in advance,

     Dave

Avatar
Discard
Best Answer

Hi,

In the error message it says, instead of getting type datetime.date you are getting bool, that means it happens when there is no value inside the field self.project_id.date_start it will return False, so you can add an if condition to check and ensure whether there is value inside the field self.project_id.date_start and execute the code. 

if self.project_id and self.project_id.date_start:
self.date_start = datetime.combine(self.project_id.date_start, datetime.time.min)

Thanks

Avatar
Discard