This question has been flagged
7 Replies
28282 Views

Hi,

I have created and added one menu item (i.e complaint) to maintenance module,this maintenance module is located in Administrator user.In this administrator user the maintenance module complaint menu item is working..If I create separate user for maintenance module then compalaint manu item is not showing..Here I am not getting any error...Here is the code


<record id="asset_complaint_tree" model="ir.ui.view">

            <field name="name">Asset Complaint</field>

            <field name="model">asset.complaint</field>

            <field name="type">tree</field>

            <field name="arch" type="xml">

                <tree string="Complaints">

                    <field name="asset_id"/>

                    <field name="product_id"/>

                    <field name="no_of_defected_products"/>

                    <field name="state"/>

                </tree>

            </field>

        </record>

  

  <record model="ir.actions.act_window" id="asset_complaint_action">

  <field name="name">Asset Complaint</field>

  <field name="res_model">asset.complaint</field>

  <field name="view_mode">tree,form</field>

  <field name="target">current</field>

  </record>

  

    

 <menuitem id="asset_complaint_menu" name="Complaints" action="asset_complaint_action" parent="asset.menu_maintenance_assets"/>

Avatar
Discard

Create Access Control List for the user from which you are testing.

Look how ACL works: https://goo.gl/4jAhtH

Best Answer

Hi Naveen,

You have to give the access right to the menu and models. First you have to add a group to menu like this, group of the employee , you can change it accordingly

<menuitem id="asset_complaint_menu" 
name="Complaints" action="asset_complaint_action" 
parent="asset.menu_maintenance_assets" groups="base.group_user"/>

Then you have to add a csv like this,

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink 
access_asset_complaint,access.asset.complaint,model_asset_complaint,base.group_user,1,1,1,1

Then this menu can be seen for the other users.

Thanks

Avatar
Discard
Author

Thanks Raphy, In that code where I have to add the csv

You can add a folder named security, inside that create a file named "ir.model.access.csv" then add the csv inside it, then specify this in the openerp file like this,`" 'security/ir.model.access.csv',"

Author

In that file I have this code: id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink

access_mrp_account_invoice_id,account.invoice,sale_stock.model_account_invoice,mrp.group_mrp_manager,1,0,0,0

Author

I added groups to that code and already I have above ir.model.access.csv code. Even I am not able to see the menu item

Activate developer mode, then go settings -> Users -> open the respective user and check whether he is manager in the mrp, if not make him as the manager

Best Answer

so for every new menuitem you add in odoo, you need to make a security file to declare, that all users can see that?

Avatar
Discard

Rather for every model that is connected to the menu action as far as I understand