コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
8785 ビュー

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 ?

アバター
破棄
最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
0
3月 15
8619
0
2月 24
28
2
10月 20
3798
2
3月 25
6791
2
2月 24
2955