This question has been flagged
5 Replies
6827 Views

Hello,

I wanted to add domain to my record having domain condition for time that is

        **<field name="domain">[('call_schedule_date', '<',time.strftime('%Y-%m-%d'))]</field>**

Avatar
Discard
Best Answer

('call_schedule_date', '&lt;', datetime.datetime.strftime('%Y-%m-%d')

You try this. i think this will help you.


Avatar
Discard

use domain or attrs

Best Answer

Hi,

Use "&lt" instead of '<'

Email : info@acespritech.com
Skype : acespritech
Blog : acespritechblog.wordpress.com

Avatar
Discard
Author

Hello,Used that one too but does nt work like how in project/project_view.xml line # 643 works

Best Answer

Not sure if this helps, but this is how I use datetimes in search view filters:

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

Main difference I can see between our code samples is mine uses double percent (%) signs in the domain and I use < instead of <

Might be worth a try.

Avatar
Discard
Author

thanks for this It helped me