Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
2540 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
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

Meilleure réponse

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
Ignorer
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.

Publications associées Réponses Vues Activité
5
août 24
46605
3
juin 23
5755
2
juin 23
4699
3
mars 23
10294
1
mars 23
2829