1

I've created a new group to hide a menu-item, so I did this :

courier.xml :

<menuitem
    id="courier_top_menu"
    name="Courier"
    action="courier_action"
    parent=""
    sequence="100"                     
/>
<record model="ir.ui.menu" id="courier_top_menu">
    <field name="groups_id" eval="[(6,0,[ref('make_courier_invisible')])]"/>
</record>        

courier_security.xml :

    <record id="make_courier_invisible" model="res.groups">
        <field name="name">Couriers Management</field>
    </record>

My issue is :

I can assign/remove an admin user to this new group to show/hide the menu, but if I create a simple user and assign him to the group, the menu doesn't appear !

Please what's the mistake in my code ?

ekad
  • 14,436
  • 26
  • 44
  • 46
BKF
  • 1,298
  • 4
  • 16
  • 35

1 Answers1

1

I can only guess, but it sounds like the normal users don't have access rights on the model behind your action courier_action. The admin/superuser doesn't need those rights, that's why it's working on him.

CZoellner
  • 13,553
  • 3
  • 25
  • 38
  • Thanks for answer, but how do I give him those rights ? – BKF Apr 03 '17 at 13:23
  • You can define model access rights like creating groups, partners or every other Odoo model. The model for model access rights is `ir.model.access`. Usually those rights will be loaded from a csv file. You will find a lot of examples all over the core modules of Odoo. – CZoellner Apr 03 '17 at 13:25