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

I have a many2one field and I want to add a domain filter to it but I cannot get it to work even though it works as a search filter.


This is how I would like to filter it

[('res_id','=',production_id.id),('res_model','=',production_id._name)]


How can I apply this to a Many2one field?

アバター
破棄
最善の回答

Try this

department_id=fields.Many2one('hr.department','Department',domain="[('company_id','=',campus_id)]")

アバター
破棄
著作者

I was sure I had tried that in the XML domain but I didn't think to try it in python with the quotations. Such a simple answer to a big headache but I am glad it worked! Thank you very much

関連投稿 返信 ビュー 活動
3
9月 20
72316
1
9月 19
3496
2
9月 23
10067
1
4月 22
2976
0
3月 15
5062