Search code examples
xmlodooopenerp-8

Using domain in Odoo colors attribute


Is it possible to have a domain-like condition in Odoo colors attribute instead of a single condition ?

example : I wanna have a condition like this colors="blue:state=='approved'&&doc_type=='revisi'"

I noticed that we could have a hidden function field that filled depend on the both fields and use it in the colors attribute, but is there the simpler way ?

Thanks


Solution

  • Yes we can use multiple condition on colors with the help of and and or for example:

    colors="blue:state=='approved' and doc_type=='revisi' "
    
    colors="blue:state=='approved' or doc_type=='revisi' "