Odoo Help


This community 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.


get partner_id form current user in search view filter

on 3/22/16, 11:56 AM 698 views

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">
<filter name="my_intervention" string="My intervention" domain="[('partner', '=', user.partner_id)]"/>

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 ?

Nicolas Clavier
On 4/27/16, 4:36 AM


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


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

Hope\ this\ helps\.\

Your Answer

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 3/22/16, 11:56 AM
Seen: 698 times
Last updated: 4/27/16, 4:36 AM