Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
1739 Prikazi

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
Opusti
Best Answer

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
Opusti
Avtor

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

Best Answer

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
Opusti
Avtor

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.

Related Posts Odgovori Prikazi Aktivnost
5
avg. 24
44957
3
jun. 23
4583
2
jun. 23
3552
3
mar. 23
9356
1
mar. 23
2154