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.

2

How to use dynamic dates in my filters? e.g. deadline date = today in project tasks

By
Frédéric Gilson (fgi)
on 6/10/14, 10:28 AM 1,064 views

Hello,

I would like to create a dynamic filter in order to easily retrieve tasks for which the deadline = today. Today is a dynamic value that changes everyday... So an advanced search is not really appropriated! How to set this?

It could be useful in lots of other contexts. In CRM for instance, retrieving all the opportunities for which the next action date = today would also useful!

This question has been included in the official documentation.
4

1. Create an advanced filter from the task interface (e.g. Deadline = 31/12/2014).

2. Go to Settings > Technical > User Interface > User-defined Filters, and open the one you just created.

3. Replace the applied filter by this one: [('date_deadline','=',time.strftime('%Y-%m-%d'))]

4. Now by using this filter in your tasks, you get in one click all the tasks that must be closed today! As easy as this!

 

You can also set up an advanced filter to get all the tasks that have to be executed this week (today + 5 days): [('date_deadline','>=',time.strftime('%Y-%m-%d')),('date_deadline','<=', (context_today() + datetime.timedelta(days=5)).strftime('%Y-%m-%d'))]

You can also go further by getting all the deadlines in the 5 coming days: [('date_deadline','>=',time.strftime('%Y-%m-%d')),('date_deadline','

Frédéric Gilson (fgi)
on 7/9/14, 4:19 AM
This question has been included in the official documentation.
-2
allu
On 7/9/14, 8:49 AM

how to check commitment date is greater than order date by 2 days,the problem am facing is commitment date and date order are datetime datatypes,give me a solution

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: 6/10/14, 10:28 AM
Seen: 1064 times
Last updated: 3/16/15, 8:10 AM