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

Hi everyone,

I have a field elist_price in my cham module, I have inherit the crm.lead view and i want to readonly field upon state field. when we set attr like this:

<field name="elist_price" attrs="{'readonly':[('state','not in','['draft']') ] }"/>

so error in terminal

Cannot eval "{'readonly':[('state','not in','['draft']') ] }".

And state field is in 'crm.lead',

elist_price is in 'my_object1'

How we set read only this thing.please give a proper solution. thank's

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

Hi,

systax error ['draft'] and not '['draft']':

<field name="elist_price" attrs="{'readonly':[('state','not in',['draft']) ] }"/>

and not

<field name="elist_price" attrs="{'readonly':[('state','not in','['draft']') ] }"/>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

you should write like this

<field name="elist_price" attrs="{'readonly':[('state','not in','draft') ] }"/>
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 11 20
17867
1
thg 9 19
4046
1
thg 1 16
14750
0
thg 3 15
3235
2
thg 5 24
9170