Odoo Help

Welcome!

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.

0

Dynamic date in filters

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

--Jérémy Kersten (jke)--
2993
| 3 2 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') )]

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

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)

Stats

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