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

My specific use case is I want to show/hide a field from list view depending on the value on the parent view. So for example, how do I show/hide a field on line items of an invoice depending on if the partner is_company or not?

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

So I created a related field in the parent say "for_entity" thats related to partner_id.is_company, added the field to the form and in the list view of the line items, I used "column_invisible" in attrs like so

attrs="{ 'column_invisible': [('parent.for_entity', '=', False)], }"

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 25
531
1
thg 3 25
1238
0
thg 11 24
1450
0
thg 6 24
1526
1
thg 6 24
2018