cannot search() entries with order "id DESC"

Bug #1044341 reported by Florent
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Status tracked in Trunk
6.1
Fix Released
Low
OpenERP Publisher's Warranty Team
Trunk
Fix Released
Low
OpenERP's Framework R&D

Bug Description

Hello,

I've experienced this bug both with 6.1 and with trunk.
When using the optional argument "order" for the osv method search(), the choice "id DESC" will sort ascending (like "id ASC" or plain "id").
It is not possible to sort by "id DESC".

The issue is in openerp.osv.orm.BaseModel._generate_order_by(...).

When the field is "id", the direction is not taken into account.
http://bazaar.launchpad.net/~openerp/openobject-server/trunk/view/head:/openerp/osv/orm.py#L4616

Please fix it for the supported branch 6.1 and for trunk.

--
Florent

Tags: maintenance

Related branches

Revision history for this message
Florent (florent.x) wrote :

The issue is also visible when clicking the header "ID" of the column in tree view: it never sorts descending.

The "_order" attribute of BaseModel is not affected. If you put _order='id DESC', the entries are displayed in descending order.
However, as soon as you click the header "ID", the direction "descending" is lost.

Revision history for this message
Florent (florent.x) wrote :

version 5.0 is not affected --> this is a regression

This is why I've put OPW noisy. This is impacting our system upgrade.

Changed in openobject-server:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
Revision history for this message
Ravi Gohil (OpenERP) (rgo-openerp) wrote :

Fix landed into main Stable V6.1 branch with,
Rev. id: <email address hidden>
Rev. no: 4278

Thanks.

Revision history for this message
SnippetBucket.com (tta-openerp) wrote :

Hello Florent,

This bug have been Fixed.

 * It has been Fixed in https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-1044341-tta
 * Revision ID: <email address hidden>

  It will be available soon in trunk.

Thanks,
Tejas - tta

Revision history for this message
Amit Parik (amit-parik) wrote :

Landed on trunk at revision 4743.1.205

Thank you!

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.