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

Task:
    
Initially the attachment button is visible to everyone,  but If a checkbox is tick (True).
    The button should only be visible to a certain group.

    I tried putting the group on the 'groups' parameter of the button and it works, but what I want to achieve is to do it dynamically (based on the checkbox's state).

Please advice, and I appreciate if you put a sample code.
Thank you so much Odoo Community. 

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

Hi,

Try with attrs,

attrs="{'invisible':[('boolean_field','=', False)]}"

Sample: 

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

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 23
10101
2
thg 3 23
2493
2
thg 5 22
4476
0
thg 3 22
1648
1
thg 5 21
4435