Skip to Content
Menu
This question has been flagged
2 Replies
535 Views

idk if its in any of the video but is there a way to restrict the access of certain categories to only that department? for example, the finance people can only access the finance category in the purchase app/product app? not with filters, but they can only access the data they need for their department? 

Avatar
Discard
Best Answer

Yes, Odoo supports this kind of access restriction, but it requires the use of record rules and security groups, not just filters.

Restrict access so that users in a department (e.g. Finance) can only see products or purchase categories relevant to them — for example, only products in the "Finance" category.

How to do it (technical overview):

1. Create a security group per department (if not already existing):

Go to Settings → Users & Companies → Groups

  • Create group: e.g., Finance Access
  • Assign it to finance users

2. Tag or classify your products/categories:

Use a custom field or existing category to mark records as "Finance", "IT", etc.

  • Example: Add a Many2one field on product.template called department_id that links to a Department model
  • Or use existing categ_id (Product Category) and name them accordingly

3. Define a record rule:

Go to Settings → Technical → Security → Record Rules

Create a rule for the group Finance Access, and apply it to product.template or product.category.

✅ Example domain:

python

CopyEdit

[('categ_id.name', 'ilike', 'Finance')]

Or if you added a department_id field:

python

CopyEdit

[('department_id.name', '=', 'Finance')]

  • Apply to Read, Write, Create, Delete as needed.
  • Scope: product.template, purchase.order, etc.

Hope this will help you!

Avatar
Discard
Best Answer

Yes, you can do this in Odoo using Record Rules and Security Groups, not just filters.

Steps:

  1. Create a security group for the department (e.g., Finance).
  2. Assign users from that department to the group.
  3. Create a record rule on product.category like:

    python

    CopiarEditar

    [('name', 'ilike', 'Finance')]

    Or use a custom field like allowed_group_ids if needed.
  4. Apply the rule only to the Finance group.
  5. (Optional) Add a similar rule to product.template to restrict products by category.

🔒 This way, Finance users will only see their categories/products, not others — it's a real access restriction, not just a UI filter.

Avatar
Discard