Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

field restriction for groups

By
Atchuthan
on 7/4/13, 7:38 AM 915 views

#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??

1
Tech Receptives
On 7/4/13, 11:41 AM

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

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

but it didnt work

Atchuthan
on 7/5/13, 2:54 AM

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

Tech Receptives
on 7/5/13, 10:39 AM

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

Atchuthan
on 7/8/13, 2:48 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/4/13, 7:38 AM
Seen: 915 times
Last updated: 3/16/15, 8:10 AM