Skip to Content
Menu
This question has been flagged
2 Replies
1723 Views

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
Discard
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
Discard
Author

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
Discard
Author

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 Replies Views Activity
5
Aug 24
44898
3
Jun 23
4548
2
Jun 23
3515
3
Mar 23
9344
1
Mar 23
2141