Odoo Help

0

Dynamic date in filters

By
Dean
on 3/22/15, 10:27 AM 1,194 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?

0
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') )]

0
ankita
On 5/1/15, 4:07 AM

Hello,

Try this

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

hope it help

0
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.

Register

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)

Stats

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