Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
9303 Vistas

I have a field which I would like present only for certain country:

<field name="org_no" attrs="{'invisible':[('country_id','!=','Sweden')]}"/>

country_id is default for 7.0:

country_id: fields.many2one('res.country', 'Country')

I understand that somehow I need to perform the search first - self.pool.get('res.country').search. But how to do it in a view?

Avatar
Descartar
Mejor respuesta


First solution is:

attrs = invisible:[('country_id.name', '!='  ,'Sweden' )]

second :

Create one related field

country_name = fields.Char(related='country_id.name', 'Coutnry name') add this field in as invisble

you can add attrs as below

attrs = invisible:[(country_name', '!='  ,'Sweden')]


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
oct 24
68751
2
dic 23
25368
1
mar 15
6447
1
mar 15
6524
3
dic 23
21191