Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

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




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

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


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 1 24
2173
1
thg 1 24
1861
0
thg 10 23
1614
0
thg 5 23
2320
2
thg 2 24
1950