Odoo Help


Dynamic date in filters

on 3/22/15, 10:27 AM 1,507 views

I'd like to have a dashboard that shows me (for example) QC Inspections that were created in the current month.  Is there a way to filter dates this way?


Jérémy Kersten (jke)

--Jérémy Kersten (jke)--

| 3 3 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 3/22/15, 11:12 AM

It should work... Let us know ...

[('create_date', '>', (datetime.datetime.now()).strftime('%Y-%m-01') )]

On 5/1/15, 4:07 AM


Try this

<filter icon="terp-check" string="Current Date" name="current_date" domain="[('date','=',((context_today()).strftime('%%Y-%%m-%%d')))]"/>

hope it help

Mario Arias Badila
On 4/30/15, 9:33 PM

Add a filter to your view similar to this one...

<filter icon="terp-go-today" string="This Month" domain="[('date','<=',context_today().strftime('%%Y-%%m-%%d')),('date','>=',context_today().strftime('%%Y-%%m-01'))]"/>

You need context_today to use the "user" timezone" when calculating the dates...

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 3/22/15, 10:27 AM
Seen: 1507 times
Last updated: 5/1/15, 4:07 AM