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

What is the equivalent attribute for attrs="{'invisible': [('one2many_field', '=', [])]}" , in odoo17?


I use invisible="assignment_ids == []" and invisible="assignment_ids == ''" and invisible="assignment_ids == False" 

But not working.

Avatar
Annuleer
Beste antwoord

Hi Hery,

You can refer to this:

in V16

<field name="categ_ids" attrs="{'invisible': [('categ_ids', '=', [])]}"/>


in V17

<field name="categ_ids" invisible="not categ_ids" options="{'icon': 'fa fa-tag', 'color_field': 'color'}"/>


Hope it helps


Avatar
Annuleer
Beste antwoord

try this way:

field name="your_field_name" invisible="['|', ('assignment_ids', '=', False), ('assignment_ids', '=', [(6, 0, [])])]"/>

In Odoo 17, the equivalent attribute for attrs="{'invisible': [('one2many_field', '=', [])]}" is attrs="{'invisible': [('one2many_field', '=', [(6, 0, [])])]}". This notation (6, 0, []) represents an empty list for a one2many field.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
3
apr. 25
888
4
mei 25
2577
2
mei 25
5955
1
mrt. 25
1716
4
mrt. 25
4564