跳至內容
選單
此問題已被標幟
1 回覆
6473 瀏覽次數

I want to add a new view and menu item to an existing user group.

How can I make that with a new module ? 

I have an security/security.xml file already there...


Thank you


頭像
捨棄
最佳答案

Hi,

If you are looking for making the view and menu item visible for users in a user group, then you have to do like this.

Suppose the menu items id is test_menu_item and the model of the corresponding view be the test.model .


Then to view the menu item for the user group, then define the menu like this,

<menuitem action="menu_action" id="test_menu_item" groups="new_user_group" sequence="1"/>


Then we have to give the access right for the model, for that we have to write csv in  Security -> ir.model.access.csv ,

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
view_test_model,view.test_model,model_test_model,new_user_group,1,1,1,1

Set the permission for read, create, write and unlink accordingly .

Thanks

頭像
捨棄
作者

I mean How can I add a modifiy in this?:

<record id="group_customer_supplier_manager" model="res.groups">

<field name="name">test</field>

<field name="category_id" ref="base.module_category_extra" />

</record>

作者

ah modifiy like something like this:

attrs="{'invisible':[('1','!=','1')]}"

If you want to modify the above record you can copy the record into your custom module and rename the id of the record as original_module_name.original_id_of_record, then you can make necessary changes inside the record

相關帖文 回覆 瀏覽次數 活動
1
5月 22
15523
2
9月 22
3826
0
12月 19
4491
2
12月 19
2810
5
6月 19
12514