Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6484 Lượt xem

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


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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>

Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 5 22
15543
2
thg 9 22
3846
0
thg 12 19
4503
2
thg 12 19
2905
5
thg 6 19
12537