Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
4201 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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


Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
kwi 25
888
4
maj 25
2578
2
maj 25
5955
1
mar 25
1717
4
mar 25
4568