Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4367 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 4 25
984
4
thg 5 25
2700
2
thg 5 25
6133
1
thg 3 25
1811
4
thg 3 25
4700