← Back to team overview

openerp-india team mailing list archive

[Bug 1084410] Re: [Trunk, 6.1 ] Order by don't work for related fields

 

Dear Wowas,
You should not change your own bug to incomplete since that means you did not provide enough information for the bug to be processed.
Please use "Opinion" instead.
Lionel Sausin.

** Changed in: openobject-server
       Status: Incomplete => Opinion

-- 
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/1084410

Title:
  [Trunk,6.1 ] Order by don't work for related fields

Status in OpenERP Server:
  Opinion

Bug description:
  Order by don't work for related fields.

  For examples:
  1)
  class mega_maintenance_order(osv.osv):
      _name = 'mega.maintenance.order'

      _columns = {
          'name': fields.char('Name', size=64, required=True),
          'counter_id': fields.many2one('mega.maintenance.counter', 'Planned Counter', ondelete='cascade'),
          'date_order': fields.related('counter_id', 'date', type='date', string='Planned Date'),
      }

      _order = 'date_order desc'

  Will generate an error.

  ProgrammingError: column "date_order" does not exist
  LINE 1: ..._order".id FROM "mega_maintenance_order" ORDER BY date_order...
                                                                                                                            ^

  2)
  order_ids = self.pool.get('mega.maintenance.order').search(cr, uid, [], limit=1, order='date_order desc')

  Will not sort order by 'date_order'

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


References