← Back to team overview

openerp-india team mailing list archive

[Bug 1070757] Re: [6.0, 6.1, trunk] Sorting object by many2one field fail

 

** Branch linked: lp:~komsas/openobject-server/trunk-bug-1070757-paulius

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/1070757

Title:
  [6.0, 6.1, trunk] Sorting object by many2one field fail

Status in OpenERP Server:
  New

Bug description:
  If object (e.g. sale.order) is sorted by many2one (e.g. _order =
  'user_id'), sorting is done by value of sale order table (user_id,
  integer) excluding many2one field value (e.g. user name).

  From the technical side I see that orm.py _generate_order_by method is
  not fully used when _search is done.

  One of fix is to set self.order for the _search function if it's order
  parameter is None.

  To reproduce bug:

  1. set _order = 'user_id' for the sale_order
  2. create user with name 'C'
  3. create user with name 'A'
  4. create user with name 'B'
  5. Create sale orders and assign each user to sale order
  6. Open sale_order list

  Result observed:
  Sale orders order are: C, A, B

  Result expected:
  Sale orders order are: A, B, C

  I've attached screenshot. Used trunk rev: 4504

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/1070757/+subscriptions


References