Group by function fields does not work properly in web.

Bug #1001659 reported by Ferdinand
42
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Confirmed
Low
OpenERP R&D Web Team

Bug Description

currently the "group by" does not compute sums for function fields (custom module)

Revision history for this message
wowas (wowas18) wrote :

It is very difficult made GROUP BY in TREE VIEW or in GRAPH VIEW, if field calculate from other fields.
For example we have table with following fields:
date (Date of production)
prod_qty (Total Quantity produced items)
reject_qty (Quantity of rejected items)
quality (Calculated field: quality = reject_qty/prod_qty)

If we try GROUP BY 'date' then for some date we get:

PROD_QTY = SUM(prod_qty of the same date)
REJECT_QTY = SUM(reject_qty of the same date)
QUALITY = SUM(quality of the same date)

But for agregate QUALITY = REJECT_QTY/PROD_QTY = SUM(reject_qty of the same date)/SUM(prod_qty of the same date)
Because it no the same as SUM(quality of the same date), need add extra code (for example rewrite function read_group())

It will be more cool if we have functional attribute for field, that will describe custom agregate function other than SUM().

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Low
status: New → Confirmed
Changed in openobject-server:
assignee: OpenERP's Framework R&D (openerp-dev-framework) → nobody
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello Ferdinand ,

I have checked this issue at my end.Currently It display a sum for function field.
So as per your bug description ("does not compute sums when use groupby ")
It only affect web client , First 2 times it display a sum of function field and
and then sum is disappear in web. Gtk works fine.so i assign this issue to web
team.

I have attached a video for both web and Gtk client.

Thanks you!

affects: openobject-server → openerp-web
Changed in openerp-web:
importance: Low → Undecided
status: Confirmed → New
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
importance: Undecided → Low
status: New → Confirmed
summary: - group by must aggregate function fields
+ group by function fields does not work properly in web.
summary: - group by function fields does not work properly in web.
+ Group by function fields does not work properly in web.
Revision history for this message
Ferdinand (office-chricar) wrote :

Hmm, I do not understand why group by is solved in the client ?

BTW
when I think it's a (web)client problem I am told it's a server issue
now it's a client issue

Revision history for this message
wowas (wowas18) wrote :

Now (from 6.1) web side it's addon of OpenERP, that in the main javascript code, that execute in browser.

Changed in openerp-web:
status: Confirmed → Invalid
Revision history for this message
Dawn Richardson (r-dawn) wrote :

Hi, this issue still seems to be effecting the current release. Unsure why it has been marked as invalid. The minor issue in mentioned in comment #4, with totals going blank when the arrow is clicked twice, is still broken.

Also, the sum of some groupings does not work for all objects. I haven't worked out a consistent pattern in the ones which it fails on, but an example is account.account. Navigating to Account > Configuration > Accounts > Accounts and grouping by anything, such as "Account Type", will result in Debit, Credit and Balance being blank.

Any explanations or further evaluation of this bug would be appreciated.

Revision history for this message
Ferdinand (office-chricar) wrote :

it affects 7.0 too

Changed in openerp-web:
status: Invalid → New
Revision history for this message
Dawn Richardson (r-dawn) wrote :

Ah, it seems only function fields with the "store" parameter set can be summed up. Is that the expected behavior?

Revision history for this message
Ferdinand (office-chricar) wrote :

that is what it does, but there are many "important" function fields in accounting, stock, project etc which can't be stored and hence are ignored or not suitable for grouping and sorting.

we have created a patch for 6.0 which allows (at least) sorting of function fields, but no one was interested in implementing in official branch

Changed in openerp-web:
status: New → Confirmed
Revision history for this message
Fabian Semal (fabian.semal) wrote :

Hello,

Any news on that issue ?

Regards,

Fabian

Revision history for this message
Yann Papouin (yann-papouin) wrote :

In the same way, I have a stored field that allow to know the picked_rate for production orders. Using a progressbar as widget displays a percent value > 100 when using GroupBy.

Revision history for this message
bruno bottacini (bruno-bottacini) wrote :

I created a widget but unfortunately requires a patch to view_list.js
lp:~bruno-bottacini/+junk/7.0-web_calc

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.