Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
6708 Vizualizări

Lets say:

Product A = product of group A or user's of group A

Product B = product of group B or user's of group B

I want that both could read,create,edit & delete products 

but cannot edit products which is not owned by the group or user

 and can be view or select by other user's in many2one field.

Imagine profil
Abandonează
Cel mai bun răspuns

@Abegail Sanchez

In this case you need to define record rule for product.product model.

You need to add many2one user_id(res.users) field on product model.

and created ir.rule record from xml for that model.

Here group will not work because it is not about field, if you want to apply field access to  perticular group than you can set group on that field. but it is about record access , you have to create rule for that.

You can take reference from any base module where ir.rule is used.

So the product will be display to associated users only.

Go to Account module : account>>security>>account_security.xml

In this file you will find number of reference for rule.

It like, Users is associated with Employee, You can see inside the employee table there many2one field of user (res.users) only log in user can see the associated employee record.

You can also check in HR Category module as well.

Hope this will help you.

Regards,

Anil.

Imagine profil
Abandonează

There is no module that will allow to create product category access group?

First when installing this module, nobody will have access to any product category and their products.

Let say I want to define some access groups and for each group have a list of users part of it. Then I would define for each group the product category the user would have access to "crud" (I mean the product part of the product category).

Cel mai bun răspuns

Hello Abegail,

You can use access rights by group wise:

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink

access_product_group_manager,access_product_group_manager,model_product_product,group_manager,1,1,1,1

access_product_user,access_product_group_manager,model_product_product,base.group_user,1,0,0,0

Hope this Helps!

Imagine profil
Abandonează

Hi How to do access right for this one ..Please explain a step by stepwise