Odoo Help

Welcome!

This community 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.

0

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

By
Guillaume Seran
on 10/20/15, 11:49 AM 514 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

2

Akhil P Sivan

--Akhil P Sivan--
3423
| 5 3 6
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')])

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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