← 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 Amit Parik,

Related field can be orderable only if it save in DB. But if I don't
want save it? I think this bug. This fields must be orderable, even if
they don't save.

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

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

-- 
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:
  Incomplete

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