Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
2037 Vistas

Hi everyone!


So I need to hide some of the child records of my object in this particular form view...

How could I filter our the records that have rs_noshow as true?

Code:


This seems like such a simple and common thing to do but I can't figure it out :(

Many thanks!!


(sorry to post the code as picture, this technical programmer form removes code if sent as text, just like in the 90's)

Avatar
Descartar
Mejor respuesta

Hi,

You can pass a domain on tree view to view the records which satisfy that condition.


eg: <field name="attribute_line_ids" widget="one2many" domaindomain="[('rs_noshow', '=', True)]" context="{'show_attribute': False}">


Hope it helps

Avatar
Descartar
Autor

Hi! thanks for the feedback. Unfortunately that's the first thing I tried and it doesn't work; it filters the potential new records, but the existing records show up regardless of the domain...
The records we want to hide are irrelevant for this view only

Mejor respuesta

Hi,

You can add the following parameter for the field attribute_line_ids,

attrs="{'invisible': [('rs_noshow', '=', True)]}

This will hide the records if rs_noshow is True.

Thanks


Avatar
Descartar
Autor

Hi Savya; thanks for the quick response!
Unfortunately that doesn't work; the context for that domain seem to be in the level of the parent object, so I get this error:
Field 'rs_noshow' used in attrs ({'invisible': [('rs_noshow', '=', True)]}) must be present in view but is missing.

Publicaciones relacionadas Respuestas Vistas Actividad
5
ago 24
45520
3
jun 23
5022
2
jun 23
4015
3
mar 23
9728
1
mar 23
2409