This question has been flagged
2 Replies
5107 Views

i'm using odoo 9 and i have created a custom module to create a new access rule to limit product creation for sale managers, But it doesn't work.i have searched for days now to find a solution but i found nothing , any idea for help please ?

security.xml

access_product_template_sale_user,product.template,model_product_template_restriction,base.group_sale_manager,1,0,0,0access_product_product_sale_user,product.product,model_product_product_restriction,base.group_sale_manager,1,0,0,0

Avatar
Discard
Best Answer

You can restrict any user from creating a new product by following these steps:

- Go to:

Settings > in "Users" Select "Manage Users"

Select the user which you need to restrict him from creating a new product.

Select "Edit" then in "Inventory" Select "User" ((Do Not Select Administrator)) then click save.

..

Settings > User & Companies > Select "Groups"

Search for "Inventory / User" then Select it

Select "Access Rights" then Select "Edit"

In the table, you will see "product.template stock user" ..

Tick inside "Create Access" to allow users to create a new product or untick to restrict the user from creating a new product.



Regards,

Yousif Al Qallaf

Avatar
Discard
Best Answer

Hi, just a few notes:

  1. I guess you meant 'ir.model.access.csv' file, not security.xml?

  2. Check that the rule is applied through the interface in the debug mode:  Settings > Techical > Security > Access Control Lists > search for object 'product'

  3. Make sure your user doesn't belong to any other user group, which has right for creating products (in the same list as above) 

Avatar
Discard