Odoo Help


How to Filter a res.partner field by category name ?

Guillaume Seran
on 10/20/15, 11:49 AM 1,193 views


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


Akhil P Sivan

--Akhil P Sivan--

| 5 4 7
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 10/20/15, 1:05 PM

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')])

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 10/20/15, 11:49 AM
Seen: 1193 times
Last updated: 10/21/15, 3:23 AM