Odoo Help


What conditions must be met so the tree view shows group sums? [Closed]

Julian Solorzano
on 5/7/13, 9:24 PM 5,367 views

The Question has been closed

Ray Carnes
on 05/08/2013 16:43:35

In the tree view of the standard invoice module, one can group by a number of fields, such as the date. Then, a total is shown for each date which is the sum of the totals of all invoices of that date.

image description

Now, I am developing a module in which I added a field to the hr.employee model, a function field of type float. I added this field to the tree view, but when I apply a group filter, the view doesn't show the sum of this new field for each group as in the case of the invoices.

image description

There is also another model I made which shows the sums without problem. In this case it is a normal float field.

image description

So, I thought the problem with the first field might be that is a function field and not a normal float, but then I checked the invoice model and amount_total is also a function field.

So my question is, what must be done so these group sums do show up?

RAY: (Edited to show images - they were inserted incorrectly)

Naresh Soni (nch)
On 5/8/13, 2:40 PM

Hello Julien,

By Default in OpenERP the float and integer fields are summed in a group Environment. If its a function field then it must be 'stored' i.e it should have the store = True attribute set.


Hello Naresh, In float field group by how to remove total in header. Please see the link help.openerp.com/question/29666/how-to-remove-sum-of-total-in-group-by/

on 9/11/13, 8:56 AM

Hello Prakash: I had replied on your original question.

Naresh Soni (nch)
on 9/25/13, 6:52 AM

Is there a way to add the store=true parameter to already existing fields somehow? e.g.: hr_timesheet.sheet.total_attendance is probably not set to store=true because there are no intermediate sums if use the group by employee filter? So how would i set this later on ?

Michael Karrer
on 12/17/13, 2:48 PM
Sudhir Arya (SA)
On 5/8/13, 1:58 AM

You are going on right way. sum attribute is used in Account Invoice tree view. That is why you can see totals in Account Invoice tree view.

These tree fields are used with sum attribute in Invoice tree view:

<field name="residual" sum="Residual Amount"/>
<field name="amount_untaxed" sum="Untaxed Amount"/>
<field name="amount_total" sum="Total Amount"/>

Same way you can also use sum attribute in your desire tree view.

Ray Carnes
On 5/8/13, 1:57 AM

Check that your field includes the sum tag when added to the treeview.

In tree view Group by Float fields header shows Total time. how to remove total time? [xml sum tag not used but it still shows total time] please see the link http://help.openerp.com/question/29666/how-to-remove-sum-of-total-in-group-by/

on 9/2/13, 5:35 AM
Julian Solorzano
On 5/8/13, 2:09 PM

I found that apparently the condition for the group sums to appear is that if it is a function field, it should be declared with the option store=True.

The sum tag in the view xml is for the bottom bar to appear, i.e. the grand total, not the partial totals.

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: 5/7/13, 9:24 PM
Seen: 5367 times
Last updated: 3/16/15, 8:10 AM