Odoo Help


keyerror when trying to create a product via sales order.

sneha antony
on 10/13/14, 1:59 AM 1,847 views

I got the following error when I tried to create a new product through the sales order.

Client Traceback (most recent call last): File "/opt/openerp/server/openerp/addons/web/http.py", line 204, in dispatch response["result"] = method(self, **self.params) File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1125, in call_kw return self._call_kw(req, model, method, args, kwargs) File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1111, in _call_kw records = req.session.model(model).read(*args, **kwargs) File "/opt/openerp/server/openerp/addons/web/session.py", line 42, in proxy result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw) File "/opt/openerp/server/openerp/addons/web/session.py", line 30, in proxy_method result = self.session.send(self.service_name, method, *args) File "/opt/openerp/server/openerp/addons/web/session.py", line 103, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info) Server Traceback (most recent call last): File "/opt/openerp/server/openerp/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/opt/openerp/server/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/opt/openerp/server/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, *params) File "/opt/openerp/server/openerp/osv/osv.py", line 190, in execute_kw return self.execute(db, uid, obj, method, *args, **kw or {}) File "/opt/openerp/server/openerp/osv/osv.py", line 132, in wrapper return f(self, dbname, *args, **kwargs) File "/opt/openerp/server/openerp/osv/osv.py", line 199, in execute res = self.execute_cr(cr, uid, obj, method, *args, **kw) File "/opt/openerp/server/openerp/osv/osv.py", line 187, in execute_cr return getattr(object, method)(cr, uid, *args, **kw) File "/opt/openerp/server/openerp/osv/orm.py", line 3625, in read result = self._read_flat(cr, user, select, fields, context, load) File "/opt/openerp/server/openerp/osv/orm.py", line 3734, in _read_flat res2 = self._columns[val[0]].get(cr, self, ids, val, user, context=context, values=res) File "/opt/openerp/server/openerp/osv/fields.py", line 1142, in get result = self._fnct(obj, cr, uid, ids, name, self._arg, context) File "/opt/openerp/server/openerp/addons/stock/product.py", line 358, in _product_available stock = self.get_product_available(cr, uid, ids, context=c) File "/opt/openerp/server/openerp/addons/stock/product.py", line 219, in get_product_available warehouse_id = shop_obj.read(cr, uid, int(context['shop']), ['warehouse_id'])['warehouse_id'][0] KeyError: 'warehouse_id'

But I am not able to trace the reason for this error .The database is the one from which I had erased all the data and is going to put all data fresh.What are the possible reasons for this particular error?

Anand Patel
On 10/13/14, 2:50 AM


I thinkd its demo data problem can you firsr please install the warehouse then check.


Ludo - 21South

--Ludo - 21South--
| 2 2 5
Zwijndrecht, Netherlands
--Ludo - 21South--


Ludo - 21South
On 10/13/14, 3:55 AM

Have you set up a multi company environment? Because it seems like the shop_id that is part of thecompany does not have a warehouse assigned to it. 

Like Anand Patel said, this might have something to do with demo data. Otherwise it might be configuration. Please check the shop configuration under sales and make sure all your shops have at lease one warehouse assigned to them.

I cant find shop under the menu SAles.Can you please explain in detail.

sneha antony
on 10/14/14, 12:57 AM

Make sure you have all the rights to warehouse/sale as well as technical features. Then you should be able to see something like warehouses or shops under the sales/configuration menu.

21south, Ludo - 21South
on 10/14/14, 4:02 AM

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

1 follower(s)


Asked: 10/13/14, 1:59 AM
Seen: 1847 times
Last updated: 3/16/15, 8:10 AM