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'))]"/>
</record>
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 forproject_id
. The domain is not getting any field named members thats why its giving error