コンテンツへスキップ
メニュー
この質問にフラグが付けられました
7 返信
30462 ビュー

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"/>

アバター
破棄

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

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

最善の回答

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

アバター
破棄
著作者

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',"

著作者

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

著作者

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

最善の回答

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

アバター
破棄

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

関連投稿 返信 ビュー 活動
1
12月 24
6010
3
8月 24
6869
4
7月 24
41164
5
4月 23
98852
3
11月 22
4304