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.

1

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

By
Julian Solorzano
on 5/7/13, 9:24 PM 4,577 views

The Question has been closed

by
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)

3

Naresh Soni (nch)

--Naresh Soni (nch)--
Tiny ERP Pvt Ltd
http://www.odoo.com
1281
| 2 2 4
India
--Naresh Soni (nch)--

Team Lead, Odoo(Formerly OpenERP) Support & OPW

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.

Thanks,

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/

Prakash
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
2

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

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.

0

Ray Carnes

--Ray Carnes--
15717
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

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/

Prakash
on 9/2/13, 5:35 AM
0
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/7/13, 9:24 PM
Seen: 4577 times
Last updated: 3/16/15, 8:10 AM