Wednesday, November 17, 2010

Domain's value depending on condition

In OpenERP view depending on condition value for the right argument can be provided.

domain="[('product_tmpl_id.categ_id.name', 'ilike',
(parent.category in ('RM', 'PM') and parent.category) or
(parent.category == 'OM' and 'Other') or
'')]"

1 comment:

  1. Hi,

    How to use the domain constraints based a many2many field

    ex:

    domain=[ ( 'many2many_field' , ' ? ' , [ any value of many2many_field ] ) ]

    I dont know which operator to use here '?'

    many2many_field contains [1,2,3]
    operator : ? (dont know) (need to check whether [1] is in the many2many list
    value : [1]

    ReplyDelete