I have a many2one field state_id from res.country.state. Based on the state I want the view to change with
attrs="{'invisible':[('state_id', '=', '39')]}
and
colors="red:state_id=='39'"
Both cause errors. So I try state_id equals 'Pennsylvania' and more errors. Then since the data is passed via JSON as an object I try state_id.id and more errors. So then I try state_id[0] with same result. There must be a way to use conditionals in views with many2one fields like this although I could not find examples in the source code of various addons. Does anybody know the way to handle this?