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

I am trying to do an AND / & condition in my attrs as you can see below.  However the ampersand is causing errors, most likely to it breaking the XML (As a special character).  I have tried escaping it after which it no longer raises and error, but it simply does render the field read only.

<field name="name" string="Product Name" attrs="{'readonly':['|','&',('groupEngineering','!=','YES'),('groupMarketing','!=','YES'),('state','!=','Completed')]}" />

Any thoughts?

Thanks,
Damien

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

Hi Damien, you can try using '&amp;' instead of '&'.

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

Using &amp; works well. Thankyou!

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

Hi,

if you want AND condition then don't add anything.


attrs="{'readonly':[('groupEngineering','!=','YES'),('state','!=','Completed')]}"


Just add '|' sign only if you want OR condition. please explain your case so we can write the appropriate condition for your case.

Ảnh đại diện
Huỷ bỏ