Access control in odoo/openerp

195 Views Asked by At

How to restrict the users to edit only the product attributes for non owned products in odoo/openerp? Can this be achieved through record rules or coding?

2

There are 2 best solutions below

0
On

You have facility to restrict the control for accessing records. In security folder create ir.model.access -- csv file.. and give like this

id                          name            model_id:id         group_id:id    perm_read    perm_write  perm_create perm_unlink
access_control_admin    model.name        model_model_name      group_admin        1           1          1              1
access_control_user     model.name        model_model_name      group_user         1           1          1              0
access_control_manager  model.name        model_model_name      group_manager      1           1          1              0
0
On

Inherit the write method of the model and give it a raise when your condition (in this case the not owned products) is met. This way the user will receive a warning message and they cannot save the changed values.