Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
2541 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Auteur

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

Beste antwoord

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
Annuleer
Auteur

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.

Gerelateerde posts Antwoorden Weergaven Activiteit
5
aug. 24
46611
3
jun. 23
5759
2
jun. 23
4705
3
mrt. 23
10298
1
mrt. 23
2830