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.

5

Relative Date (today, this month, e.g.) in Filter

By
Robert Klüsener
on 5/22/13, 2:08 PM 9,841 views

How can I use a relative date like for example today for filtering?

I filtered all due / overdue invoices in the suppliers invoice list using the attribute "due date" "is less or equal than". As I want to create a template from this filter it should not refer to a concrete date like 22.05.2013 but to the relative date. So I could use the template every day without modification.

This question has been included in the official documentation.
7

Borni DHIFI

--Borni DHIFI--
5102
| 6 8 9
Tunis, Tunisia
--Borni DHIFI--

Techno Functional Consultant Odoo(OpenERP) 

http://www.linkedin.com/in/borni

Skype : dhifi.borni

Borni DHIFI
On 4/2/15, 1:43 AM

Hi, To manage filters active mode developer *Activate the developer mode*. in displayed list choose Manage Filters and add your filter. in domain [['date_invoice','=',time.strftime('%Y-%m-%d')]] Thanks.

@Borni DHIFI, i am sorry. I tried to add your post for developer info using Promote to Doc. but instead clicked wrongly on Convert as a comment. I am very sorry.

Atchuthan - Technical Consultant, Sodexis Inc
on 4/2/15, 1:44 AM
This question has been included in the official documentation.
4

Ray Carnes

--Ray Carnes--
15677
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 4/1/15, 10:27 PM

In version 8, you can now do this:

  

In version 9, you can use this as a filter:

<filter string="Today" domain="[('date_field_from_the_model_you_want_to_filter', '&gt;=', datetime.datetime.now().strftime('%Y-%m-%d 00:00:00')),('date_field_from_the_model_you_want_to_filter', '&lt;=',datetime.datetime.now().strftime('%Y-%m-%d 23:23:59'))]"/>

Is there a way to save the filter in that manner? I am looking for a way to save the relative filter for a report

Sophie Kowalski
on 3/8/16, 5:26 AM

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

1 follower(s)

Stats

Asked: 5/22/13, 2:08 PM
Seen: 9841 times
Last updated: 6/13/16, 3:28 PM