Odoo Help


This community 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.


Can't validate supplier invoice & create new project after upgrade

Yakir Sabag
on 6/16/13, 7:06 AM 2,065 views

This is the short error I get when I try to validate the invoice. ValueError: Sorting field company_id not found on model res.company

This is the same error description I get when I try to create new project.

Anyone has any idea? I can't actually use the system because of it.

Full Trace is: OpenERP Server Error Client Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/openerp-7.0_20130415_111315-py2.6.egg/openerp/addons/web/http.py", line 203, in dispatch response["result"] = method(self, **self.params) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130415_111315-py2.6.egg/openerp/addons/web/controllers/main.py", line 1140, in exec_workflow return req.session.exec_workflow(model, id, signal) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130415_111315-py2.6.egg/openerp/addons/web/session.py", line 148, in exec_workflow r = self.proxy('object').exec_workflow(self._db, self._uid, self._password, model, signal, id) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130415_111315-py2.6.egg/openerp/addons/web/session.py", line 31, in proxy_method result = self.session.send(self.service_name, method, *args) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130415_111315-py2.6.egg/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/python2.6/site-packages/openerp-7.0_20130415_111315-py2.6.egg/openerp/addons/web/session.py", line 90, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, params) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, *args, *kwargs) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/osv/osv.py", line 220, in exec_workflow res = self.exec_workflow_cr(cr, uid, obj, signal, args) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/osv/osv.py", line 213, in exec_workflow_cr return object._workflow_signal(cr, uid, [res_id], signal)[res_id] File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/osv/orm.py", line 3926, in _workflow_signal result[res_id] = wf_service.trg_validate(uid, self._name, res_id, signal, cr) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/workflow/wkf_service.py", line 119, in trg_validate res2 = instance.validate(cr, id, ident, signal) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/workflow/instance.py", line 43, in validate workitem.process(cr, witem, ident, signal, force_running, stack=stack) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/workflow/workitem.py", line 60, in process ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/workflow/workitem.py", line 175, in _split_test _join_test(cr, t[0], t[1], ident, stack) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/workflow/workitem.py", line 183, in _join_test create(cr,[activity], inst_id, ident, stack) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/workflow/workitem.py", line 40, in create process(cr, res, ident, stack=stack) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/workflow/workitem.py", line 52, in process result = _execute(cr, workitem, activity, ident, stack) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/workflow/workitem.py", line 106, in _execute returned_action = wkf_expr.execute(cr, ident, workitem, activity) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/workflow/wkf_expr.py", line 67, in execute return _eval_expr(cr, ident, workitem, activity['action']) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/workflow/wkf_expr.py", line 57, in _eval_expr ret = eval(line, env, nocopy=True) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/tools/safe_eval.py", line 241, in safe_eval return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict) File "", line 1, in <module> File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/osv/orm.py", line 374, in function_proxy return attr(self._cr, self._uid, [self._id], *args, *kwargs) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130415_111315-py2.6.egg/openerp/addons/account/account_invoice.py", line 1003, in action_move_create move_obj.post(cr, uid, [move_id], context=ctx) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130415_111315-py2.6.egg/openerp/addons/account/account.py", line 1321, in post new_name = obj_sequence.next_by_id(cr, uid, journal.sequence_id.id, c) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130415_111315-py2.6.egg/openerp/addons/base/ir/ir_sequence.py", line 220, in next_by_id company_ids = self.pool.get('res.company').search(cr, uid, [], order='company_id', context=context) + [False] File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/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/python2.6/site-packages/openerp-7.0_20130415_111315-py2.6.egg/openerp/addons/base/res/res_company.py", line 197, in _search context=context, count=count, access_rights_uid=access_rights_uid) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/openerp/osv/orm.py", line 4847, in _search order_by = self._generate_order_by(order, query) File "/usr/lib/python2.6/site-packages/openerp-7.0_20130615_231352-py2.6.egg/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



| 6 5 8
Delhi, India
Python OpenERP Developer http://in.linkedin.com/pub/sandeep-rana/3b/a16/786/
On 6/17/13, 10:47 AM


check out your your company , did you remove the default company ?? that is actually mean your current company id (selected in that invoice relation) has been removed

so plz check out this


Where can I reach that setting?

YSTC, Yakir Sabag
on 6/17/13, 10:57 AM

you can see in company menu in settings check weither defualt company is there or not

on 6/17/13, 10:58 AM

it is seems , you removed that

on 6/17/13, 10:59 AM

or you removed that company ,which is linked to your invoice

on 6/17/13, 11:00 AM

I installed the Multi company plugin recently.

YSTC, Yakir Sabag
on 6/17/13, 11:02 AM

And the company still exists, but I cannot see any Default Company field on this page.

YSTC, Yakir Sabag
on 6/17/13, 11:03 AM

I'm using OpenERP 7...

YSTC, Yakir Sabag
on 6/17/13, 11:03 AM

I didn't have access to the "Multi-Company" in my user and I enabled it... but still that doesn't help.

YSTC, Yakir Sabag
on 6/18/13, 5:45 AM

you can see yoru all access rights from settings-&gt;technical --&gt;database structure adn then check the access right wither it is there or not

on 6/18/13, 6:02 AM

But it's not a matter of access, otherwise I would get the Access Denied error. It has something to do with this column, probably somewhere the Company is missing but I can't find where... I looked almost for all the objects and my company name is set on all of them.

YSTC, Yakir Sabag
on 6/18/13, 6:03 AM


| 5 4 7
Bangalore, India

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

On 6/17/13, 9:55 AM


This error generally means, that there doesn't exist a field "company_id" in the columns and yet that fields is referred in SORT constraints..

So do check out, whether that field is required are not, if it is not requited then remove the constraints mapped to those fields..

Hope this helps u...

what if it's required? which it is.

YSTC, Yakir Sabag
on 6/18/13, 6:30 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 6/16/13, 7:06 AM
Seen: 2065 times
Last updated: 3/16/15, 8:10 AM