Odoo Help


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.


lessthan and greated than operator for domain in xml

on 10/15/14, 7:25 AM 1,470 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.

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)


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