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.

0

Odoo 8 Reporting : Get data average instead of data sum

By
Yassine TEIMI
on 12/15/15, 7:14 AM 1,424 views

On odoo reporting, there is by default a total row giving the float or integer field sum, this field is on the measure selection box
There is necessarily a method allowing to do a sum operation (maybe using sum sql aggregate function), I want to override this method to allow me do a data average (maybe a svg sql aggeregate function) instead of sum, and just for one specified reporting (the one I'm developping), and not for all Odoo reportings.

Here is a picture that summarizes what I want to do.

1

Axel Mendoza

--Axel Mendoza--
10195
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 12/15/15, 7:25 PM

@Yassine TEIMI

To change that you just need to define group_operator = 'avg' in the measure field definition of the model class

So I should overwrite the measure field definition on the report model I'm using, then I can get the avg as a operator only for desired report ? on the other hand, I'm looking for the original measure field definition, on the models.py (ORM) but can't find it.

Yassine TEIMI
on 12/16/15, 5:35 AM

when I said measure field definition I really mean to say the definition of the field used as measure of the pivot table graph view that you need to group using avg, that field in your report model need to have the group_operator = 'avg'

Axel Mendoza
on 12/16/15, 9:16 AM

did you test it?

Axel Mendoza
on 12/17/15, 3:46 AM

Great ! It works fine, thanks a lot Axel :)

Yassine TEIMI
on 12/21/15, 6:38 AM

@Axel, How can I change the 'total' string (see http://prntscr.com/9eexf9) in to 'average' ?

Yassine TEIMI
on 12/21/15, 6:40 AM

I don't know how to do it without an extension

Axel Mendoza
on 12/21/15, 11:05 AM

How is it possible to do it with an extension ?

Yassine TEIMI
on 12/21/15, 11:18 AM

Please create another question for that, to explain all the steps of how to do it in an answer without mix things

Axel Mendoza
on 12/21/15, 11:28 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)

Stats

Asked: 12/15/15, 7:14 AM
Seen: 1424 times
Last updated: 12/21/15, 6:38 AM