Odoo Help


Allow managers to acess their own projects

on 5/20/13, 6:30 AM 1,413 views

I have created a new module for consumption.That is consumption details about a project will save here.I have created two roles users and managers(members of the projects).Users will create consumption details they can see their own consumption.In case of manager he want to see all consumption details of his project.We will set one user as manager it may be project memeber or project manager.Anyway he need to see all consumption details related to his projects.How to write the record rule for this scenario. (Example Project 'A' has three members a1,a2,a3 a3 is set as the manager of our module(he may or maynot be the project manager of this project) a1 and a2 will prepare consumption chart related to this project, a3 wants to all consumption chart created by a1 and a2 related to the project 'A') I have tried this

<record id="property_rule_mat_mgmt_officer" model="ir.rule">
            <field name="name">Material Manage Rule1</field>
            <field model="ir.model" name="model_id" ref="project.model_project_project"/>
            <field name="domain_force">['|',('project_id.members','=',user.id),('project_id.user_id','=',user.id)]</field>
            <field name="groups" eval="[(4,ref('group_mat_mgmt_officer')), (4,ref('group_mat_mgmt_manager'))]"/>

But got an error

ValueError: Invalid field 'project_id.members' in domain expression

is there any members field defined in relation to project_id? and what is the defenition given for project_id. The domain is not getting any field named members thats why its giving error

on 5/21/13, 5:00 AM
Mind And Go
On 5/14/14, 5:11 PM


I think the you're working directly on project so my experience would be this :

  1. Create a new many2many field in res.users and call it projects_ids then simply try :
    ['|',('project_id.user_id','=',user.id),('id','in',[p.id from p in user.projects_ids])]

Hope it could help

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/20/13, 6:30 AM
Seen: 1413 times
Last updated: 3/16/15, 8:10 AM