Skip to Content
Menu
This question has been flagged
551 Views

I want to apply a domain filter on my view list to allow the current user to see the records of my model (my model contains an 'id_called' field) which are associated with the curent user and i ensure this task by a domain filter in my view list like that:


xml version="1.0"?>
<odoo>
record id="record_call_views"model="ir.actions.act_window"> ​    <field name="name">Call Recordfield> ​<field name="res_model">call.recordfield> ​    <field name="view_mode">tree,formfield>
​<field name="context">{'default_id_called': uid}field>
​<field name="domain">[('id_called','=', context.get('default_id_called'))]
field>
record>
odoo>





what i want to do besides that is allow user with uid=2 to see all records of all users.

I tried this solution but it didn't work:
xml version="1.0"?>
<odoo>
record id="record_call_views"model="ir.actions.act_window"> ​    <field name="name">Call Recordfield> ​<field name="res_model">call.recordfield> ​    <field name="view_mode">tree,formfield>
​<field name="context">{'default_id_called': uid}field>
​<field name="domain">[('id_called','=', context.get('default_id_called'))] if context.get('default_id_called')!='2' else [1,'=',1)]
field>
record>
odoo>


could you please help me

I thank you in advance




Avatar
Discard