Odoo Help

4

1
4 Answers
6
Pierre Verkest France
9/26/14, 5:35 PM

Hi,

Probably a bit late!

You could override the read_group method like this on you model:

    def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
        if 'intake_time' in fields:
            fields.remove('intake_time')
        return super(MyClassName, self).read_group(cr, uid, domain, fields, groupby, offset, limit=limit, context=context, orderby=orderby)

8 Comments
Anybox, Pierre Verkest France
9/26/14, 5:38 PM

I let a 'c' on the if condition, unfortunately, I haven't enough karma to edit my own post!...

Karina Delgado United States
10/2/14, 2:02 PM

I completely agree with this method, I tried it and it works! Thank you.

Camptocamp SA, Yannick Vaucher Switzerland
11/25/14, 7:11 AM

Thanks for this tip. It still work in Odoo 8.0

Camptocamp SA, Yannick Vaucher Switzerland
11/25/14, 7:14 AM

By the way I fixed the extra 'c'

Mathieu Laflamme Canada
8/26/16, 4:31 PM

Not too late at all. Thanks. Still works on Odoo 9.0.

Mathieu Laflamme Canada
8/29/16, 3:35 PM

Ok after struggling with another issue on the pivot view, I figured out this hack is causing problem... seems like the pivot view is confused on the groups and javascript is crashing when selecting measures or "Expand all". I think the js code can be fixed to fully support the hack here and I will fill a ticket at Odoo.

Mathieu Laflamme Canada
8/29/16, 5:39 PM

There is no issue with the pivot finally!!! Problem is that last line should be:

return super(ReportDetailInvoice, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby, lazy).

Tai Le Thanh Vietnam
6/7/17, 11:23 PM

tks, it works, but I must change the first and last line

first line : ... , lazy=True) :

last line : ... , lazy=lazy)

0
Avatar

Prakash India

--Prakash--

11631
| 6 7 9
Bikaner, India
--Prakash--

OpenERP Developer at SunARC Technology

Prakash India
9/6/13, 6:01 AM

The default Float field value for group_operator shows sum of value

Reference link http://www.zbeanztech.com/blog/group-operator-openerp-grouping

Currently "Group by" Field values able to change to min, max, avg

But unable to remove group by value

i applied group_operator = None or group_operator = False but its still shows sum of total. How to group_by remove sum or set to value None

Any update?..

0
Avatar

Francesco OpenCode Italy

--Francesco OpenCode--

3949
| 7 8 11
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo Developer. Python lover. Beer addicted.

LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode Italy
8/30/13, 11:26 AM

If the field has the tag sum in the tree view, when you use the group by you have the sum of all records. Remove the sum tag from view so you has'nt the sum when use group by

0
Avatar

Naresh Soni (nch) India

--Naresh Soni (nch)--
--Naresh Soni (nch)--

Team Lead, Odoo(Formerly OpenERP) Support & OPW

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

Hello Prakash,

By default OpenERP Will consider 'SUM' as group operator . So you wan't be able to remove this behavior easily by any sort of configuration or xml code. For this you need to make changes in the orm.py in def read_group method and comment out the code that adds the default 'SUM' to integer and float fields at line 2664.

Hope this helps !

1 Comment
Prakash India
9/25/13, 7:41 AM

Thanks for reply i will try

Ask a Question
Writer
11631
Prakash
Keep Informed
1 follower(s)
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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now