This question has been flagged
5 Replies
7522 Views

After doing a fresh install and only installing the sales component I ran in to the following failure :

openerp 7 ValueError : Sorting field company_id not found on model res.company

I didn't change the "Your Company" nor any other settings.

Can anybody help me with this ? Thank you already!!

(extended information added at the end of this post)

OpenERP Server Error

Client Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/openerp/addons/web/http.py", line 203, in dispatch response["result"] = method(self, *self.params) File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1074, in call_kw return self._call_kw(req, model, method, args, kwargs) File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1066, in _call_kw return getattr(req.session.model(model), method)(args, **kwargs) File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 43, in proxy result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw) File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 31, in proxy_method result = self.session.send(self.service_name, method, *args) File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 104, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 90, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 293, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, params) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 188, in execute_kw return self.execute(db, uid, obj, method, *args, *kw or {}) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, args, *kwargs) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 197, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 185, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/usr/lib/pymodules/python2.7/openerp/addons/sale/sale.py", line 340, in create vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'sale.order') or '/' File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_sequence.py", line 262, in get return self.get_id(cr, uid, code, 'code', context) File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_sequence.py", line 254, in get_id return self.next_by_code(cr, uid, sequence_code_or_id, context) File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_sequence.py", line 237, in next_by_code company_ids = self.pool.get('res.company').search(cr, uid, [], order='company_id', context=context) + [False] File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2354, in search return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count) File "/usr/lib/pymodules/python2.7/openerp/addons/base/res/res_company.py", line 197, in _search context=context, count=count, access_rights_uid=access_rights_uid) File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 4847, in _search order_by = self._generate_order_by(order, query) File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 4815, in _generate_order_by raise ValueError( _("Sorting field %s not found on model %s") %( order_field, self._name)) ValueError: Sorting field company_id not found on model res.company

Avatar
Discard

I suggest You need to pull the latest openerp Code. It will works fine. pull addons, web addons and server.

Author

I just updated it through the latest nightly build and now it works! Thank you for your reaction!

could you please tell me witch version u updated with cause i tried many but with no luck my installed version is openerp-8.0dev-20130206-011033

Author

Dear Mohamed, I tried it with the nightly build of openerp 7.0. That could make the difference. You might wanna try that. 7 is also the current release.

Best Answer

Hai 

Michael Bos
Py file: If you want register number is need ascending order speacify this code,

Class classname(models.Model):
    _order='reg_no asc'


View file: If you want email is descending order wise arrange that time specify below code

<tree default_order="st_email desc">
Avatar
Discard