تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1557 أدوات العرض

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


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يناير 24
2140
1
يناير 24
1846
0
أكتوبر 23
1584
0
مايو 23
2280
2
فبراير 24
1938