Access rights in odoo

1).Create a new file module/security/security.xml
2) Create module/security/ir.model.access.csv
3). Finally update openacademy/

 'data': [


4). Edit security.xml

 <record id="vetclinic_group_user" model="res.groups">
 <field name="name">Vetclinic / User</field>
 <record id="rule_vetclinic_group_user" model="ir.rule">
 <field name="name">Vetclinic / User</field>
 <field name="model_id" ref="model_vetclinic_animal"/>
 <field name="groups" eval="[(4, ref('vetclinic_group_user'))]"/>
 <field name="perm_read" eval="1"/>
 <field name="perm_write" eval="0"/>
 <field name="perm_create" eval="0"/>
 <field name="perm_unlink" eval="0" />
 <field name="domain_force">[('user','=',]</field>

5). Edit ir.model.access.csv

id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
clinic_user Clinic User model_vetclinic_animal vetclinic_group_user 1 0 0 0

6). .py class

class vetclinic_animal(osv.osv):
 _name = "vetclinic.animal"
 _columns = {
 'name' : fields.char('Name', size=64),
 'birthdate' :'Birth Date'),

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s