Skip to Content
Menu
This question has been flagged
1 Reply
5323 Views

Hello, 

I have ceated a many2one field :

class SomeClass(models.Model)
    'partner_field' = fields.Many2one('res.partner','my partner field')


In this field, I only want to have partner where the partner field 'category_id' contains the category named 'cat one' for example

How can I do thi ?


I tried something like this :  domain="('category_id.name','=','cat one')"
But It not works

Avatar
Discard
Best Answer

Try like this:

class SomeClass(models.Model)
_name = 'some.class'
partner_field = fields.Many2one('res.partner','my partner field',domain=[('category_id.name', '=','cat one')])
Avatar
Discard
Related Posts Replies Views Activity
1
Aug 23
12545
1
Aug 23
11039
1
Jul 23
7220
4
Apr 23
8676
2
Feb 23
17589