Odoo Help


Domain filter with '&' doesn't work in openerp7

on 10/16/13, 4:27 AM 3,411 views


Below is what i need to do

(Condition A and Condition B) or Condition C

(partner_id = partner_id and user_ids = context.get(uid)) or userid = 1

The possible domain filters i've tried are



Nothing works out and the error i get is below

 File "D:\workspace\Techtalk\openerp\modules\loading.py", line 76, in <lambda>
   load_data = lambda *args: _load_data(cr, *args, kind='data')
 File "D:\workspace\Techtalk\openerp\modules\loading.py", line 124, in _load_data
   tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
 File "D:\workspace\Techtalk\openerp\tools\convert.py", line 941, in convert_xml_import
   doc = etree.parse(xmlfile)
 File "lxml.etree.pyx", line 2698, in lxml.etree.parse (src/lxml/lxml.etree.c:49590)
 File "parser.pxi", line 1513, in lxml.etree._parseDocument (src/lxml/lxml.etree.c:71423)
 File "parser.pxi", line 1543, in lxml.etree._parseFilelikeDocument (src/lxml/lxml.etree.c:71733)
 File "parser.pxi", line 1426, in lxml.etree._parseDocFromFilelike (src/lxml/lxml.etree.c:70648)
 File "parser.pxi", line 997, in lxml.etree._BaseParser._parseDocFromFilelike (src/lxml/lxml.etree.c:67944)
 File "parser.pxi", line 539, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:63820)
 File "parser.pxi", line 625, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:64741)
 File "parser.pxi", line 565, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:64084)
XMLSyntaxError: xmlParseEntityRef: no name, line 144, column 12

Links i've refered are



Additional Notes I could not find a single domain filter with & operator in openerp source.

Am i missing something? Kindly suggest. Thanks for your time.


Try using '&amp;' instead of '&'


E.g. this is used @ crm module (https://github.com/odoo/odoo/blob/8.0/addons/crm/crm_lead_view.xml#L98)

Thanks to give the same answer I gave before you !

Cyril Gaspard (GEM)
on 2/6/15, 3:19 AM

@GEM, sorry... i didn't check the answer below

Atchuthan - Technical Consultant, Sodexis Inc
on 2/6/15, 3:33 AM
Daniel Reis
On 10/16/13, 6:44 AM

It looks like you're using the domain in an XML file, not in Python code. Probably context.get('uid') doesn't work there. Try using just uid instead.

I am sorry Daniel that's not the prob. context.get('uid') works perfectly in xml and uid won't work instead. Kindly clarify.

on 10/16/13, 6:57 AM

In XML usually user.id is used.

on 2/5/15, 10:25 PM

@Ivan, usually user.id is used only for defining a domain_force in access rule(ir.rule)

Atchuthan - Technical Consultant, Sodexis Inc
on 2/6/15, 12:14 AM
Mohammed Mansour
On 2/5/15, 9:26 AM

You will find the answer here by @Ray Carnes

Really it's very good answer


and to read more about Openerp Polish notation open this link http://en.wikipedia.org/wiki/Polish_notation

Lady Sharmane Udtuhan
On 10/21/13, 7:45 AM

Try This:


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

2 follower(s)


Asked: 10/16/13, 4:27 AM
Seen: 3411 times
Last updated: 3/27/15, 6:38 PM