sorting in report view

Bug #1060086 reported by Pollet Alexandre
40
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Low
OpenERP Publisher's Warranty Team

Bug Description

Hello,

In the sale report view, when i try to sort by "total price" (it's does'nt work with other fields either), the sorting is incorrect.

So I can't see my best partner (for example)

I don't have the problem with classic tree view.

See the screeshot attached.

Related branches

Revision history for this message
Pollet Alexandre (a-pollet) wrote :
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Pollet,

Would you please try with the same thing with trunk 7.0 cause I have checked this issue with trunk and it's working fine.

Please try with trunk 7.0 and let us know about it.

Thanks and waiting for your reply!

Changed in openerp-web:
status: New → Incomplete
Revision history for this message
Pollet Alexandre (a-pollet) wrote :

Still doesn't work...

serv rev : 4601
addons rev : 8141
web rev : 3502

affects: openerp-web → openobject-addons
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
status: Incomplete → Confirmed
Amit Parik (amit-parik)
tags: added: usability
summary: - [6.1] sorting in report view
+ sorting in report view
Revision history for this message
Javier Fuentes (javier-codeback) wrote :

Problem persists in v7. Seems related with the grouping of data.

Regards.

tags: added: maintenance
Changed in openobject-addons:
assignee: OpenERP R&D Addons Team 2 (openerp-dev-addons2) → OpenERP Publisher's Warranty Team (openerp-opw)
Revision history for this message
Olivier Laurent (Acsone) (olivier-laurent) wrote :

Hello OpenERP Team,

Any news about the fixing of this issue ?

The bug is located in the read_group method of the BaseModel in orm.py arround this line of code:
    data_ids = self.search(cr, uid, [('id', 'in', alldata.keys())], order=order, context=context)
that tries to introduce the sort _AFTER_ the fetch of data rows with the sql query that preceeds.

Unfortunately, the domain passed to the search method is based on a collection of aggregate ids (i.e. min(id)) for which the sort is made on their own fields values _NOT_ on the aggregate values computed by the sql query.

It would be better to introduce the sort directly in the sql query with a classic "ORDER BY" clause.

Many thanks in advance for the fix.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

This issue has been initially fixed in server 7.0 at revision 5237, and further fixed/refined in the next revisions (please grab the latest).

Thanks for reporting!

PS: moving this bug to server, as it was a generic framework concern

Changed in openobject-addons:
milestone: none → 7.0
status: Confirmed → Fix Released
affects: openobject-addons → openobject-server
Changed in openobject-server:
milestone: 7.0 → none
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.