Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
1567 Представления

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




Аватар
Отменить
Автор Лучший ответ

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


Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
янв. 24
2153
1
янв. 24
1850
0
окт. 23
1593
0
мая 23
2305
2
февр. 24
1946