Odoo Ayuda

1

get partner_id form current user in search view filter

By
oLiVe007
on 22/03/16 11:56 2.038 vistas

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 ?

0

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\.\

Acerca de esta comunidad

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

Herramientas de las preguntas

2 seguidor(es)

Estadísticas

Preguntado: 22/03/16 11:56
Visto: 2038 veces
Última actualización: 27/04/16 04:36