I want to compare date of duration of leaves with the current date in odoo python

Viewed 1316

Here is the program which i wrote and inherited from hr.holidays that if the selected date is before the current date then it should provide an error message. Code-

from datetime import date

if self.date_from <= date.today():
            print 'You cannot select the previous date'

But it gives the error-

TypeError: can't compare datetime.date to bool

Thanks

1 Answers
Related