Odoo Help

Welcome!

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.

0

TypeError: 'bool' object has no attribute '__getitem__'

By
sneha antony
on 5/22/14, 4:58 AM 2,699 views

When I try to add an item in the order line or make any changes in the sales order in draft state,the following error is being displayed.What might be the reason for this error?Can anyone please help me in resolving this?

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 1117, in _call_kw
    return getattr(req.session.model(model), method)(*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/addons/sale_stock/sale_stock.py", line 613, in product_id_change
    compare_qty = float_compare(product_obj.virtual_available * uom2.factor, qty * product_obj.uom_id.factor, precision_rounding=product_obj.uom_id.rounding)
  File "/opt/openerp/server/openerp/osv/orm.py", line 497, in __getattr__
    return self[name]
  File "/opt/openerp/server/openerp/osv/orm.py", line 405, in __getitem__
    field_values = self._table.read(self._cr, self._uid, ids, field_names, context=self._context, load="_classic_write")
  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]
TypeError: 'bool' object has no attribute '__getitem__'

2
Jos De Graeve
On 5/22/14, 7:21 AM

Hello,

It looks like your sales shop does not have a warehouse defined on it, or you don't have read permissions on that warehouse.

Look in Sales -> Configuration -> sales shop to see is everything is ok.

Regards,

Jos

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)

Stats

Asked: 5/22/14, 4:58 AM
Seen: 2699 times
Last updated: 3/16/15, 8:10 AM