Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Filter Invoices that are due within the next 7 days

Robert Klüsener
on 9/9/13, 7:23 AM 446 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))]]

Frank Kubsda
On 9/23/15, 4:33 AM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 9/9/13, 7:23 AM
Seen: 446 times
Last updated: 9/23/15, 4:33 AM