Odoo中XML attrs的域过滤器运算符

问题描述 投票:1回答:2

有我的问题,我得到了:

(A and B) or (C and D)

在域名我写:

[ '|', (A, B), (C, D) ]

但它不起作用,并引发错误:

错误:未知字段document_receive_type,!=,vn_post in domain [“|”,[[“document_receive_type”,“!=”,“direct”],[“state”,“!=”,“vn_post_check”]],[ [ “document_receive_type”, “!=”, “vn_post”],[ “状态”, “!=”, “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)] 

它没有错误,但它不像我想要的那样显示我的按钮。

openerp odoo-10
2个回答
1
投票
(A and B) or (C and D)

如果你想得到它,你的域名将是:

['|', '&', (A), (B),'&',(C),(D)]

并使用您的数据:

['|', '&amp;', ('document_receive_type','!=','direct'), ('state', '!=', 'vn_post_check'),'&amp;',('document_receive_type','!=','vn_post'),('state', '!=', 'result_profile_returned')]

有关域名的更多信息,请访问:domain-notation

我希望我能帮到你


1
投票

试试这个:

attrs="{'invisible': ['|', '&amp;',('document_receive_type','!=','direct'), ('state', '!=', 'vn_post_check'), '&amp;', ('document_receive_type','!=','vn_post'), ('state', '!=', 'result_profile_returned')]}"
© www.soinside.com 2019 - 2024. All rights reserved.