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

#Hi friendz,

   In my module, I need to display password to group - 'bms_admin_group' and
                        to display ***** instead of password for group - 'bms_public_group' with the help of `password=True`.

In my scenario 'bms_admin_group' inherits 'bms_public_group'

I tried the following methods to implement but failed

1. using attrs

 <field name="password"  attrs="{'password': [('groups', '=', 'bms_public_group')]}" />

2. providing same field with multi groups like below

 <field name="password" password="1" groups="bms_public_group" />
 <field name="password" password="0" groups= "bms_admin_group" />
-in this method, the visibility is working fine but when i try to save the record, it is showing value not filled

Can we provide restriction for this field "passcode" for various groups??

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

in general that's not the case, either you show a field or you hide it completely. So based on the user group, you can do that using attrs feature of openerp.

Cheers,

Parthiv

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

i tried using attrs="{'password': [('groups', '=', 'my_group')]}"

but it didnt work

no, it won't. you just have to use invisibleattribute, to hide the field completely.

Tác giả

If I use invisible, i cant show the password in ** and also if i am checking the validation for password also not possible if i use INVISIBLE

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 24
2279
3
thg 4 23
11753
1
thg 4 23
14758
9
thg 12 23
24048
1
thg 5 20
6497