Odoo Help


Group by a many2many field

on 6/24/13, 7:06 PM 6,202 views

Hi all. Maybe someone could provide a solution:

Is it possible to use a many2many field in the "Group by" of a search view?

Very good question. In particular, I would really like to see my Partners grouped by Category / v7 Tags ...

Daniel Reis
on 7/12/13, 2:13 PM

Grover Menacho

--Grover Menacho--
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Odoo Developer

Grover Menacho
On 7/12/13, 5:34 PM

I've tried and it's not possible.

After thinking a while I understood why. Let me explain my theory:

A belongs to categ1 categ2

B belongs to categ 2 categ 3

C belongs to categ1 categ 3

Okay if you list this three items:

  • A
  • B
  • C

But if you try to group them by categ. You'll have to repeat A two times B two times and C two times. Group doesn't intend to repeat data it just group the data into sets without common data.

If group worked on many2many it'll do something like this.

  • categ1: A C
  • categ2: B
  • categ2: (empty)

Because it'll show only once the registry and it'll catch them by priority.

Anyways this doesn't work. So if you want to group a many2many you have to do it by python code it's a little bit complicated but I think that there is a way to do it.


Ghanshyam Prajapati

--Ghanshyam Prajapati--

| 4 4 8
Pune, India
--Ghanshyam Prajapati--
OpenERP Developer
Ghanshyam Prajapati
On 6/25/13, 4:03 AM

Hi Nazarii,

Try Following link,

Many2many domain filtering on v6

Hope it work for you.

Hi Ghanshyam, thanks for reply. But i have no problems with filtering by many2many field, i have a problem with grouping by many2many.

on 6/25/13, 4:41 AM

Hi Nazarii, If your problem is solved, then please mark my answer as solved.

Ghanshyam Prajapati
on 6/25/13, 4:43 AM

Hi again, my problem is not solved as the answer is not related to my question.

on 6/25/13, 6:44 AM

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

0 follower(s)


Asked: 6/24/13, 7:06 PM
Seen: 6202 times
Last updated: 3/23/15, 10:07 AM