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

Is it possible define in form view dynamic domain for multiple IDs, like (this don't work):

<field name="category_ids"/>
<field name="task_id" domain="[('category_id','in',category_ids)]"

For static domain it work:

<field name="category_ids"/>
<field name="task_id" domain="[('category_id','in',[1,2])]"

アバター
破棄
最善の回答

It should be [('category_id','in',category_ids[0][2])].  I presume category_ids is either one2many or many2many fields.  Entries in those type of fields are usually represented as [(6, 0, [id1, id2, ...])].  By getting category_ids[0][2] you'll get the [id1, id2, ...] part.

アバター
破棄
著作者

Thank you! That work :)

最善の回答

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

Hope it helps, Thanks

アバター
破棄
最善の回答

Hello Vasiliy Birukov,

I think you are written wrong syntax.

so i will be write this line will be help you.

<field name="task_id" domain="[('category_id', 'in', (category_ids))]" />

Regards,

Ankit H Gandhi

アバター
破棄
著作者

Wrong propose. Don't work :(

関連投稿 返信 ビュー 活動
0
4月 23
5220
0
6月 22
2880
2
5月 24
9167
0
3月 23
2106
0
4月 22
3608