以下是我需要做的
(Condition A and Condition B) or Condition C
(partner_id = partner_id **and** user_ids = context.get(uid)) **or** userid = 1
我尝试过的可能的域过滤器是
domain="['|',('user_ids','=',1),'&',('partner_id','=',partner_id),('user_ids','=',context.get('uid'))]"
domain="['|','&',('partner_id','=',partner_id),('user_ids','=',context.get('uid')),('user_ids','=',1)]"
没有任何效果,我得到的错误如下
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
我引用的链接是
http://help.openerp.com/question/2170/domain-notation-using-multiple-and-nested-and/
附加说明 我在 openerp 源代码中找不到带有 & 运算符的单个域过滤器。
我错过了什么吗?请建议。谢谢你的时间。