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

How create filter for specific day based on field datetime?

By
Luís
on 8/18/14, 1:45 PM 812 views

Hi,

All modules have field create_date

I need create a filter to know all records for a specific day. It's possible?

Imagine that:

I have two records with different create_date (ex: 2014-08-17 13:35:46.093446 and 2014-08-18 14:55:43.745183).
I want search for a specific day, ex: "2014-08-17". In this case my flter returns one record -> 2014-08-17 13:35:46.093446. 

I try this code, but without results:

<field name="create_date" domain="[('create_date','&lt;=',(self.strftime('%%Y-%%m-%%d %%H:%%M:%%S')),('create_date','&gt;=',(self.strftime('%%Y-%%m-%%d %%H:%%M:%%S'))]"/>

Thanks in advance.

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: 8/18/14, 1:45 PM
Seen: 812 times
Last updated: 3/16/15, 8:10 AM