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

I want to make certain column fields in Notebook->table widget editable for certain users and readonly for other users.how can i do that?can anyone help me to fix it?

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

Hi,use attrs for the field in XML: defined create_uid in .py:

'create_uid': fields.many2one('res.users', 'Author', select=True, readonly=True),

the doc for create_uid link

  • create_uid: user who created the record
  • create_date: date when the record was created
  • write_uid: last user who changed the record
  • write_date: date of the last change to the record

Then in XML:

<field name="xxx" string=xxx" attrs="{'readonly':[('create_uid','!=',uid)]}"/>

But that the uid is currently not supported in the attrs attribute:

https://bugs.launchpad.net/openobject-server/+bug/920033

more details you may refer to:

Link

Hope it will help you!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 23
2261
3
thg 2 20
16049
0
thg 4 24
1292
1
thg 9 23
1317
1
thg 11 21
16375