Odoo Help

0

0
3 Answers
2
Adarsh Patel
07-01-19 06:05

Hello Gagandeep

Please Try below Record Rules.

For Manager:-

<record id="id" model="ir.rule">
<field name="model_id" ref="model_(model_name)" />
<field name="name">for Manager</field>
<field name="domain_force">[(1,'=',1)]</field>
<field name="groups" eval="[(4,ref('base.group_user'))]"/>
</record>

For Employee:-

<record id="rule_id" model="ir.rule">
<field name="name">for Employee</field>
<field name="model_id" ref="model_(model_name)"/>
<field name="domain_force">[('employee_id.user_id','=',user.id)]</field>
<field name="groups" eval="[(4,ref('base.group_user'))]"/>
</record>


0
Gagandeep Kaur
07-01-19 12:11

Actually I have group Employees which contain both managers and employees groups, so only one rule applied on both groups . either its show all record to all employees or only their own record(same for manager)

-1
Avatar

subbarao

--subbarao--

1216
| 5 1 7
Chennai, India
--subbarao--


subbarao
07-01-19 05:57

Hello

by using [('employee_id.user_id','=',user.id)]  we can filter login user mapped employees,

by using ['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id)]  we can filter child's




Stel een vraag
Keep Informed
1 volger(s)
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