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

Hi i newbie in python and odoo.


Can i return value from python code to action domain in xml or not ?

because i need to use domain like [('create_uid','=',...)] <--- number in array

or convert below this code to python and return them on start load view 

<record id="purchase_rfq_sale" model="ir.actions.act_window">            
<field name="name">Requests for Quotation(Sale)</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.order</field>
<field name="context">{}</field>
<field name="domain">[]</field>
<field name="view_mode">tree,form,graph,calendar</field>
<field name="search_view_id" ref="purchase.view_purchase_order_filter"/>
<field name="help" type="html">
</field>
</record>
アバター
破棄

if you want to filter record by created user id try

[('create_uid','=',uid)]

最善の回答

in your python code you can return like this:

return { 'name': 'Partner to Lead',

             'type': 'ir.actions.act_window',

             'view_type': 'form',

             'view_mode': 'tree,form',

             'res_model': 'res.partner',

             'views': [(treeview_id, 'tree')],

             'target': 'current',

             'domain' : domain,

}

which is the domain variable is the array of your domain.

アバター
破棄
関連投稿 返信 ビュー 活動
2
12月 22
15458
1
11月 21
5527
0
1月 21
2798
8
5月 20
8476
0
12月 23
3384