Record Rule for user groups in openerp -
i have created new module in openerp contain consumption details related each project. have created 2 user groups module (user,manager).user can create consumption details of project , can see consumption details has created. give permission this
<record id="property_rule_mat_mgmt_user" model="ir.rule"> <field name="name">material manage rule</field> <field model="ir.model" name="model_id" ref="model_mat_mgmt"/> <field name="domain_force">[('create_uid','=',user.id)]</field> </record> it working fine
similarly if assign user manager of module can see consumption details of projects,in member or manager.how write rule, tried different ways can't find proper rule.
this 1 of rule have tried
<record id="property_rule_mat_mgmt_manager" model="ir.rule"> <field name="name">material manage manager rule</field> <field model="ir.model" name="model_id" ref="project.model_project_project"/> <field name="domain_force">['|',('user_id','=',false),('user_id','=',user.id)]</field> </record>
for record, have been easier answer if give details of model, mat.mgmt one. perhaps that's why there no answer yet.
let's have many2one relationship between mat.mgmt , project.project named project_id, use this:
<record id="property_rule_mat_mgmt_manager" model="ir.rule"> <field name="name">material manage manager rule</field> <field model="ir.model" name="model_id" ref="model_mat_mgmt"/> <field name="domain_force">['|',('project_id.user_id','=',false),('project_id.user_id','=',user.id)]</field> </record> notice model still model_mat_mgmt model on filtering applied. didn't want filter projects mat.mgmt if understand correctly question.
Comments
Post a Comment