Skip to Content
Menu
This question has been flagged
2 Replies
4278 Views

Dear all,

Hope you are fine all of you 

i did new module in odoo 11 & how i can show new module in Application Accesses to give users permission (read - write - delete) or (user - officer - manager)

plz i need help !!!!!

Thanks & Best Regards 

Hazem

Avatar
Discard
Best Answer

Hello

Make a folder in your app named 'security'. In the security folder create a file called ir.model.access.csv. Inside it

 

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink

your_first_access_right_id,your access right name,model_your_app_folder_name,hr.group_hr_manager,1,1,1,1

your_sec_access_right_id,your access right name,model_your_app_folder_name,hr.group_hr_user,1,1,0,0

your_third_access_right_id,your access right name,model_your_app_folder_name,base.group_user,1,0,0,0


This will give all employees read access, officers read and write access, all managers read, write, create and delete access rights. Add this file in your manifest. restart and upgrade.

Here we used existing odoo groups employee,officer,manager(base.group_user, hr.group_hr_user, hr.group_hr_manager resp).

If you need to create new groups for your model, refer yenthe's blog 

https://www.odoo.yenthevg.com/creating-security-groups-odoo/


Avatar
Discard
Best Answer

Hi,

If you have created new models and menus in your module you have to give them access rights so that only it will be visible for all users.

If you create any new menu add groups attribute with your menu and also give access rights for the models.

<menuitem id="abcd" name="Test" parent="tst_id" action="test_action" 
groups="base.user_group"/>

Also, give access rights for the model, check this link: https://www.odoo.com/documentation/10.0/reference/security.html


Thanks

Avatar
Discard