Odoo Help


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

Michael Bos
on 11/12/13, 6:02 AM 3,703 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

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

Anil R. Kesariya
on 11/12/13, 6:15 AM

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

Mibo, Michael Bos
on 11/12/13, 6:37 AM

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

Al-jouhara, Mohamed Sobhy
on 3/3/14, 5:13 PM

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.

Mibo, Michael Bos
on 3/4/14, 5:02 AM
On 6/14/16, 3:36 AM


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">

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 11/12/13, 6:02 AM
Seen: 3703 times
Last updated: 6/14/16, 3:36 AM