1

I need to add users for my module and need some menuitem restriction for them.mainly i created user and manager roles.in Settings -> Users -> create user -> Access Rights and i change User or Manager.but no affect for that user and not shows any menu items to them.main menu item also not shows. I added code in bpl_security.xml and that xml file mapped in openerp.py file. is anything missing to me.?please check my code and advice

<?xml version="1.0" ?>
<openerp>
    <data>
        <record model="ir.module.category" id="module_checkroll_category">
            <field name="name">Checkroll</field>
            <field name="description">manager-create new products</field>
            <field name="sequence">16</field>
        </record>
        <record id="group_checkroll_user" model="res.groups">
            <field name="name">Checkroll_User</field>
            <field name="category_id" ref="module_checkroll_category" />
        </record>
        <record id="group_checkroll_manager" model="res.groups">
            <field name="name">Checkroll_Manager</field>
            <field name="implied_ids" eval="[(4, ref('group_checkroll_user'))]" />
            <field name="category_id" ref="module_checkroll_category" />
            <field name="users" eval="[(4, ref('base.user_root'))]" />
        </record>
    </data>
</openerp>

my whole code uploaded here & see its' bpl_view.xml line no 705

here shows my related part in view.xml

<menuitem id="menu_bpl" name="Checkroll/Registration" groups="group_checkroll_manager,group_checkroll_user" />
<menuitem id="menu_bpl_ref" name="Reference" parent="menu_bpl"
groups="group_checkroll_user" />
<menuitem id="menu_bpl_logic" name="Company Specific" parent="menu_bpl"
groups="group_checkroll_manager" />
Priyan RockZ
  • 1,605
  • 7
  • 40
  • 68

2 Answers2

6

I not found any ir.model.access.csv for access rights in your module. You have to create ir.model.access.csv in your module, I suggest you to create a security folder and put security related file there

Like

Security
  ----ir.model.access.csv
  ----sale_security.xml

and change in openerp.py file like

'security/sale_security.xml', 'security/ir.model.access.csv',

And in the ir.model.access.csv file provide access rights like this:

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sale_shop,sale.shop,model_sale_shop,base.group_user,1,0,0,0
access_sale_order,sale.order,model_sale_order,base.group_sale_salesman,1,1,1,0

access_sale_shop is the id for the your access it will be anythin you can write this like a,access_sale_shop1, access_sale_shop2 etc..

name is in name of object , sale.shop is the name of your object

perm_read,perm_write,perm_create,perm_unlink are for read, write, create , unlink it you give 1 means this group have rights , 0 means not rights, like if you give in perm_create meand user can create in thi object, hope this clear for you

model_id is the id of your model here model_sale_shop add model at your object in you module it will be like : for this object bpl.deduction.estate.data it will be model_bpl_deduction_estate_data

Dale E. Moore
  • 431
  • 7
  • 19
user1576199
  • 3,217
  • 3
  • 20
  • 32
0

I think, You also need to check the access rights, that we assign for each object like who can manage which operations (edit/delete/create/read) for that object. I can see two groups from yourside: Checkroll_User and Checkroll_Manager but did you assign any access rights for objects to these groups ?

Priyesh Solanki
  • 707
  • 4
  • 6