This question has been flagged

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

Avatar
Discard
Best Answer

HI

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

Thanks
Sandeep

Avatar
Discard
Author

Where can I reach that setting?

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

it is seems , you removed that

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

Author

I installed the Multi company plugin recently.

Author

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

Author

I'm using OpenERP 7...

Author

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

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

Author

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.

Best Answer

Hi

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

Avatar
Discard
Author

what if it's required? which it is.