Odoo Help


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.


Create Group By filter on child field

Victor Godayer
on 7/16/14, 5:33 AM 909 views


I have an extended model of `res.partner` with a field named `x_subsidiary_of`.


When I am in the search view of customer invoices I would like to group invoices by this `x_subsidiary_of` field.

I've tried to modify the search view adding the following line :

    <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id.x_subsidiary_of'}"/>


But I get this error :

    AssertionError: Fields in 'groupby' must be regular database-persisted fields (no function or related fields), or function fields with store=True

How could I achieve this ?


René Schuster

--René Schuster--
| 5 5 8
Weinheim, Germany
--René Schuster--

Challenge Everything!

René Schuster
On 7/16/14, 5:50 AM

What type is your x_subsidiary_of field?

Extend the invoice module and use field.related and store=True.

Then add the field to you customer invoice view (with invisible="1" if you like).




Type is many2one. I try your tip and will let you know the result. Cheers

Victor Godayer
on 7/16/14, 6:34 AM

Thanks that worked like a charm :)

Victor Godayer
on 7/17/14, 9:35 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

1 follower(s)


Asked: 7/16/14, 5:33 AM
Seen: 909 times
Last updated: 3/16/15, 8:10 AM