コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
7805 ビュー
<group>
                            <field name="id" invisible="1"/>
                            <field name="q_versions" widget="selection" on_change="onchange_version(id)" domain="[('sale_id', '=', id)]"/>
                            </group>
                        <group>
                            <button name="add_version" string="add version" type="object" class="oe_edit_only" />

there is a error, that id is not defined. how can i use dynamic domain

アバター
破棄

I am also facing the same problem...

Note: we can define domain="[('sale_id', '=', id)]" only in py file

when widget="selection" is used in xml, the domain provided in python file gets overridden

最善の回答

You can follow this: https://youtu.be/XGqXEL2qQmE 

Hope it helps, Thanks

アバター
破棄
最善の回答

You cannot use field id because id field is automatically generated by orm of OpenERP.

You can use active_id or active_ids which indicates your current active records.

Try this:

domain="[('sale_id', '=', active_id)]"
アバター
破棄
著作者

active_id alse show 'active_id' not defined
there is no active_id in my context

関連投稿 返信 ビュー 活動
2
5月 24
9222
1
1月 22
11985
1
7月 20
16039
6
1月 24
16256
3
7月 25
4121