Odoo Help


lessthan and greated than operator for domain in xml

on 10/15/14, 7:25 AM 5,055 views


I am added a domain for a many2one field like shown below:

<field name="my_field" domain="[('field1_date','<',date1)]" />

where my_filed is a many2one field with reference class class_ref, field1_date is a datetime field in reference class (class_ref) and date1 is date field in current class. I am getting the following error:

"Unescaped '<' not allowed in attributes values"

Please help me with a solution.


Thanks in advance.

Piyush Suva
On 10/15/14, 7:33 AM

use domain =[('field1_date','&lt;',date1)]

It will work

for > use &gt;

    < use &lt;

 <= use &lt;=

>= use &gt;=

On 10/15/14, 7:56 AM

Thank you Piyush Suva. It worked.

About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/15/14, 7:25 AM
Seen: 5055 times
Last updated: 3/16/15, 8:10 AM