Skip to Content
Menu
This question has been flagged

When I create a new user, that new user automatically assigned to have admin right in purchase inventory module. 


I have other module that have 3 access right. Admin, Technical, and User. I want technical and user access right is read only towards product template regardless of any right from purchase inventory module

I already add below access right in the csv security


access_product_template_for_technique,model_product_template,model_product_template,my_module.group_parameter_technique,1,0,0,0
access_product_template_for_utilisateur,model_product_template,model_product_template,my_module.group_parameter_user,1,0,0,0
access_product_product_template_for_technique,model_product_template,product.model_product_template,my_module.group_parameter_technique,1,0,0,0
access_product_product_template_for_utilisateur,model_product_template,product.model_product_template,my_module.group_parameter_user,1,0,0,0
access_sale_product_template_for_technique,sale_model_product_template,sale.model_product_template,my_module.group_parameter_technique,1,0,0,0
access_sale_product_template_for_utilisateur,sale_model_product_template,sale.model_product_template,my_module.group_parameter_user,1,0,0,0


But technical and user still can create and edit product template

When I change purchase right from admin to user, that user is read only towards product template.

My goal is I want technical and user access right is read only towards product template regardless of any right from purchase inventory module




Avatar
Discard
Author Best Answer

I found the solution. According to this post https://www.odoo.com/id_ID/forum/help-1/how-to-override-base-model-access-rights-in-my-custom-module-148065 

I should add  original_module_name.original_id   in my module and replace the right access. So the final code is below


stock.access_product_template_stock_manager,product.template stock_manager,product.model_product_template,stock.group_stock_manager,1,0,0,0
purchase.access_product_template_purchase_manager,product.template purchase_manager,product.model_product_template,purchase.group_purchase_manager,1,0,0,0
access_product_template_for_admin,model_product_template,product.model_product_template,my_module.group_parameter_administrator,1,1,1,1
access_product_template_for_technique,model_product_template,product.model_product_template,my_module.group_parameter_technique,1,0,0,0
access_product_template_for_utilisateur,model_product_template,product.model_product_template,my_module.group_parameter_user,1,0,0,0


Even if the user have Admin right over odoo and all model, we can replace the right access in the new module


Avatar
Discard
Related Posts Replies Views Activity
1
Jan 24
2126
1
Jan 24
1833
0
Oct 23
1568
0
May 23
2256
2
Feb 24
1924