I would like to create a date filter in the "Tomorrow" rental module.
There is a "Today" filter.
datetime.datetime.combine(context_today(), datetime.time(0, 0, 0)) to datetime.datetime.combine(context_today(), datetime.time(23, 59, 59))
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I would like to create a date filter in the "Tomorrow" rental module.
There is a "Today" filter.
datetime.datetime.combine(context_today(), datetime.time(0, 0, 0)) to datetime.datetime.combine(context_today(), datetime.time(23, 59, 59))
Try this:
# Function to return tomorrow's date
def context_tomorrow():
return datetime.date.today() +
datetime.timedelta(days=1)
# Start of tomorrow
start_of_tomorrow =
datetime.datetime.combine(context_tomorrow(),
datetime.time(0, 0, 0))
# End of tomorrow
end_of_tomorrow =
datetime.datetime.combine(context_tomorrow(),
datetime.time(23, 59, 59))
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up