Skip to Content
Menú
This question has been flagged
1 Respondre
8698 Vistes

I am trying to create custom filter to show the intervention of the current user.

 <record model="ir.ui.view" id="module.interventionVs">
<field name="model">module.intervention</field>
<field name="arch" type="xml">
<search>
<filter name="my_intervention" string="My intervention" domain="[('partner', '=', user.partner_id)]"/>
</search>
</field>
</record>

but I didn't understand why I can access to user form the search filter domain.

I tryed "uid.partner_id" or "context.get('user').partner_id" but that didn't work.

How I can access to the current record of res.user to get the partner_id field ?

Avatar
Descartar
Best Answer

Hello, 

you might find a work around by subclassing the search method as explained here for the old API:

\https\:\/\/answers\.launchpad\.net\/openobject\-server\/\+question\/192521\\\

You\ may\ resolve\ your\ user\'s\ partner\_id\ and\ conceive\ a\ domain\ to\ expend\ arguments\ of\ the\ super\(\)\ search\ method\.\\
\\\

Hope\ this\ helps\.\

Avatar
Descartar
Related Posts Respostes Vistes Activitat
0
de març 15
8495
0
de febr. 24
28
2
d’oct. 20
3690
2
de març 25
6630
2
de febr. 24
2828