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

hi all,

I have a model (child) which contains a field named 'mparent', it stores 'name' field values ​​from its parent

have another Many2one field which point to itself to select records from

I have to filter this Many2one field with values ​​are in 'mparent', so the only related data will be present to user to select one

i did something like below but it shows error at runtime (here Household is the value mparent field contains): ValueError: Invalid domain term ('mparent', 'in', 'Household') 


in my mdel:

    sparent = fields.Many2one ('mymodel.subcat', string = "Sel Parent", domain = "[('mparent', 'in', mparent)]")


please help, how to do this?

looks


アバター
破棄
著作者 最善の回答

its done, removed 'in' and used '=' in domain, now it works fine.

thanks to all :)


アバター
破棄
関連投稿 返信 ビュー 活動
2
4月 23
2710
2
2月 25
40404
2
11月 22
2796
1
2月 22
7818
2
1月 22
2767