Odoo 中 XML 属性的域过滤器运算符
Domain filter operator for XML attrs in Odoo
这是我的问题,
我得到了:
(A and B) or (C and D)
在我写的域中:
[ '|', (A, B), (C, D) ]
但它不起作用,并引发错误:
Error: Unknown field document_receive_type,!=,vn_post in domain
["|",[["document_receive_type","!=","direct"],["state","!=","vn_post_check"]],[["document_receive_type","!=","vn_post"],["state","!=","result_profile_returned"]]]
这是我的代码:
<button name="action_mark_done"
string="Mark Done"
type="object" class="oe_highlight"
attrs="{'invisible': ['|', (('document_receive_type','!=','direct'), ('state', '!=', 'vn_post_check')), (('document_receive_type','!=','vn_post'), ('state', '!=', 'result_profile_returned')) ,]}"
groups="bms_cpdt.group_e_gov_manager"/>
我单独试过
['&', (A), (B),]
或
['&', (C), (D),]
它仍然有效并显示我的按钮,但如果
['|', '&', (A), (B),'&',(C),(D)]
它没有错误,但它没有像我想要的那样显示我的按钮。
试试这个:
attrs="{'invisible': ['|', '&',('document_receive_type','!=','direct'), ('state', '!=', 'vn_post_check'), '&', ('document_receive_type','!=','vn_post'), ('state', '!=', 'result_profile_returned')]}"
(A and B) or (C and D)
如果你想得到它,你的域将是:
['|', '&', (A), (B),'&',(C),(D)]
还有你的数据:
['|', '&', ('document_receive_type','!=','direct'), ('state', '!=', 'vn_post_check'),'&',('document_receive_type','!=','vn_post'),('state', '!=', 'result_profile_returned')]
有关域的更多信息,您可以访问:
domain-notation
希望对您有所帮助
这是我的问题, 我得到了:
(A and B) or (C and D)
在我写的域中:
[ '|', (A, B), (C, D) ]
但它不起作用,并引发错误:
Error: Unknown field document_receive_type,!=,vn_post in domain ["|",[["document_receive_type","!=","direct"],["state","!=","vn_post_check"]],[["document_receive_type","!=","vn_post"],["state","!=","result_profile_returned"]]]
这是我的代码:
<button name="action_mark_done"
string="Mark Done"
type="object" class="oe_highlight"
attrs="{'invisible': ['|', (('document_receive_type','!=','direct'), ('state', '!=', 'vn_post_check')), (('document_receive_type','!=','vn_post'), ('state', '!=', 'result_profile_returned')) ,]}"
groups="bms_cpdt.group_e_gov_manager"/>
我单独试过
['&', (A), (B),]
或
['&', (C), (D),]
它仍然有效并显示我的按钮,但如果
['|', '&', (A), (B),'&',(C),(D)]
它没有错误,但它没有像我想要的那样显示我的按钮。
试试这个:
attrs="{'invisible': ['|', '&',('document_receive_type','!=','direct'), ('state', '!=', 'vn_post_check'), '&', ('document_receive_type','!=','vn_post'), ('state', '!=', 'result_profile_returned')]}"
(A and B) or (C and D)
如果你想得到它,你的域将是:
['|', '&', (A), (B),'&',(C),(D)]
还有你的数据:
['|', '&', ('document_receive_type','!=','direct'), ('state', '!=', 'vn_post_check'),'&',('document_receive_type','!=','vn_post'),('state', '!=', 'result_profile_returned')]
有关域的更多信息,您可以访问: domain-notation
希望对您有所帮助