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

states="done,ignore"

states="draft"

attrs="{'readonly':[('state','in',['done','ignore'])]}"

attrs="{'required':[('type','in',['sms'])],'invisible':[('type','in',['mail','chat'])]}"

Ảnh đại diện
Huỷ bỏ
Tác giả

in odoo17 attrs and states is no longer supported brother

Câu trả lời hay nhất

You can review the Documentation to learn about that changes

https://www.odoo.com/documentation/17.0/developer/reference/user_interface/view_architectures.html#semantic-components

Use readonly and required and invisible 



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

You can give like this,

       attrs="{

           'readonly': [('state', 'in', ['done', 'ignore'])],

           'required': [('type', 'in', ['sms'])],

           'invisible': [('type', 'in', ['mail', 'chat'])],

           'string': 'Custom Label'

       }"/>

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 24
1038
1
thg 11 24
839
0
thg 1 24
831
5
thg 10 24
2406
5
thg 12 24
5367