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.

6

Group by a many2many field

By
nazarii
on 6/24/13, 7:06 PM 4,231 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
3

Grover Menacho

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

Systems Engineer + MBA

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.

0

Ghanshyam Prajapati

--Ghanshyam Prajapati--
1377
| 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.

nazarii
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.

nazarii
on 6/25/13, 6:44 AM

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

0 follower(s)

Stats

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