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.


display current day by default when accessing list view

John Pia Jr
on 7/7/14, 5:02 PM 738 views

I would like to know how to automatically display records in a list due based on the due date date being the current day.


for example I would like to be able to be shown only delivery orders (grouped by status) on the current day when accessing the delivery order list view.


how can i set a default filter to do this?



Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 7/7/14, 10:23 PM


You should have a date field which stores the date. On the action, you should write the domain,

Use a domain like this :

domain = [('date', '=', context_today())]

domain = [('date','=',datetime.strftime('%%Y-%%m-%%d') )]"

domain = [('date','=',time.strftime('%%Y-%%m-%%d'))]

You may create a default filter in search view:

<filter icon="terp-go-today" string="Today" domain="[('date','&lt;=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Today"/>

This should help.


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

2 follower(s)


Asked: 7/7/14, 5:02 PM
Seen: 738 times
Last updated: 3/16/15, 8:10 AM