OpenERP 7 How to give users access to custom module in OpenERP 7?

Create a one Security folder which has below two files. For example,

  • test_security.xml and
  • ir.model.access.csv

security/test_security.xml file

<?xml version="1.0" encoding="utf-8"?>
    <data noupdate="0">
        <record model="ir.module.category" id="module_category_name_test">
            <field name="name">Management</field> 
            <field name="sequence">7</field>

        <record id="group_name_test_user" model="res.groups">
            <field name="name">User</field>
            <field name="category_id" ref="module_category_name_test"/>
            <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>

        <record id="group_name_test_manager" model="res.groups">
            <field name="name">Manager</field>
            <field name="category_id" ref="module_category_name_test"/>
            <field name="implied_ids" eval="[(4, ref('group_name_test_user'))]"/>
            <field name="users" eval="[(4, ref('base.user_root'))]"/>

After do this Management Option show with two selection value like User and Manager in setting => Users => Access Rights => Application

Now turn for security/ir.model.access.csv

unique_id,, model_test_name, group_name_test_user, 1,1,0,0
unique_id,, model_test_name, group_name_test_manager, 1,1,1,1 is a table name.

Example of csv file, how to create? Where

  • Fields => Value => Description

  • id => access_testing_for_user => id must be unique.

  • name => testing.for.user => name is given as we want.

  • model_id:id => model_test_name => model_id:id is given like model_our_class_name.

  • group_id:id => group_name_test_user => group_id:id is xml id of above we create like for User and Manager.

  • perm_read => 1 for True and 0 for False for read record.

  • perm_write => 1 for True and 0 for False for write record.

  • perm_create => 1 for True and 0 for False for create record.

  • perm_unlink => 1 for True and 0 for False for delete record.


These two files .xml and .csv must be listed in as other view files are given.

Leave a Comment