← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 675976] Re: error when reordering of Customers based on Country

 

*** This bug is a duplicate of bug 629332 ***
    https://bugs.launchpad.net/bugs/629332

Hello Julian,

This is because some dynamically computed fields cannot be used as sort criterions, and this bug is thus a duplicate of bug 629332, so I will mark it as so.
We don't know yet if this will stay as a limitation or if we will implement a workaround for this.

Thanks for the report

** This bug has been marked a duplicate of bug 629332
   Function,related fields do not get sorted
 * You can subscribe to bug 629332 by following this link: https://bugs.launchpad.net/openobject-server/+bug/629332/+subscribe

-- 
error when reordering of Customers based on Country
https://bugs.launchpad.net/bugs/675976
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Server: New

Bug description:
Using trunk as of today ie Openerp-server rev 3014 

I consistently get this error with a newly created clean database. I get same error with gtk client too.

To reproduce
1. Go to Sales, Address Book, Customers
2. Click on Column header 'Country'
Then you get the error.
Ordering on City doesn't order correctly, but doesn't give an error. I have reported this previously as bug https://bugs.launchpad.net/openobject-client-web/+bug/660710

Environment Information : 
System : Linux-2.6.35-22-generic-x86_64-with-Ubuntu-10.10-maverick
OS Name : posix
Distributor ID:	Ubuntu
Description:	Ubuntu 10.10
Release:	10.10
Codename:	maverick
Operating System Release : 2.6.35-22-generic
Operating System Version : #35-Ubuntu SMP Sat Oct 16 20:45:36 UTC 2010
Operating System Architecture : 64bit
Operating System Locale : en_GB.UTF8
Python Version : 2.6.6
OpenERP-Client Version : 6.0.0-rc1-1
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/home/openerp/production/openerp-server/bin/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/home/openerp/production/openerp-server/bin/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/home/openerp/production/openerp-server/bin/osv/osv.py", line 57, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/openerp/production/openerp-server/bin/osv/osv.py", line 140, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/openerp/production/openerp-server/bin/osv/osv.py", line 130, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/openerp/production/openerp-server/bin/osv/orm.py", line 1835, in search
    return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
  File "/home/openerp/production/openerp-server/bin/osv/orm.py", line 4048, in _search
    order_by = self._generate_order_by(order, query)
  File "/home/openerp/production/openerp-server/bin/osv/orm.py", line 4015, in _generate_order_by
    order_by_clause = self._generate_m2o_order_by(order_field, query)
  File "/home/openerp/production/openerp-server/bin/osv/orm.py", line 3976, in _generate_m2o_order_by
    assert order_field_column._classic_write or getattr(order_field_column, 'store', False), "Many2one function/related fields must be stored to be used as ordering fields"
AssertionError: Many2one function/related fields must be stored to be used as ordering fields





References