Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 5/20/13, 6:30 AM|
|Seen: 1011 times|
|Last updated: 3/16/15, 8:10 AM|