This question has been flagged
1 Reply
2118 Views

How can I filter all invoices that are due within the next 7 days? I tried the following code and it does not work out:

[['date_due', '<=', time.strftime('%Y-%m-%d %H:%M:%S',time.gmtime(time.time()+7243600))]]

Avatar
Discard
Best Answer

Hello Robert,


you can use:

domain = [('date_due','<=', (context_today()+datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d 23:59:59'),('date_due','>=',(context_today()).strftime('%%Y-%%m-%%d 00:00:00'))]


regards Frank


Avatar
Discard