1
votes

There is my problem, I got:

(A and B) or (C and D)

In domain i write:

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

But it not work, and raise error:

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"]]]

Here is my code:

<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"/>

I've tried individually

['&', (A), (B),] 

or

['&', (C), (D),] 

it still work and show my button but if

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

it has no error but it is not show my button like i want.

2

2 Answers

1
votes
(A and B) or (C and D)

If you want to get that, your domain would be:

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

And with your data:

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

For more information about domains you can visit: domain-notation

I hope I've helped

1
votes

Try with this:

attrs="{'invisible': ['|', '&amp;',('document_receive_type','!=','direct'), ('state', '!=', 'vn_post_check'), '&amp;', ('document_receive_type','!=','vn_post'), ('state', '!=', 'result_profile_returned')]}"