← Back to team overview

openerp-india team mailing list archive

[Bug 1062634] Re: [Trunk] Linst Index out of range, when Company's New clicked.

 

Attaching a printscreen:


** Attachment added: "image"
   https://bugs.launchpad.net/openobject-addons/+bug/1062634/+attachment/3378023/+files/bugbadlist.png

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1062634

Title:
  [Trunk] Linst Index out of range, when Company's New clicked.

Status in OpenERP Addons (modules):
  New

Bug description:
  Go to Company's news.

  A traceback appear.

  OpenERP Server Error
  Client Traceback (most recent call last):
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/addons/web/common/http.py", line 182, in dispatch
      response["result"] = method(controller, self, **self.params)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/addons/web/controllers/main.py", line 1206, in call_kw
      return self._call_kw(req, model, method, args, kwargs)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/addons/web/controllers/main.py", line 1168, in _call_kw
      return getattr(req.session.model(model), method)(*args, **kwargs)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/addons/web/common/openerplib/main.py", line 250, in proxy
      args, kw)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/addons/web/common/openerplib/main.py", line 117, in proxy
      result = self.connector.send(self.service_name, method, *args)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/addons/web/common/session.py", line 66, in send
      raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)

  
  Server Traceback (most recent call last):
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/addons/web/common/session.py", line 51, in send
      return openerp.netsvc.dispatch_rpc(service_name, method, args)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/netsvc.py", line 362, in dispatch_rpc
      result = ExportService.getService(service_name).dispatch(method, params)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/service/web_services.py", line 585, in dispatch
      res = fn(db, uid, *params)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/osv/osv.py", line 167, in execute_kw
      return self.execute(db, uid, obj, method, *args, **kw or {})
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/osv/osv.py", line 121, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/addons/audittrail/audittrail.py", line 503, in execute_cr
      return fct_src(cr, uid, model, method, *args, **kw)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/osv/osv.py", line 164, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/addons/mail/mail_message.py", line 328, in message_read
      record = self._message_dict_get(cr, uid, msg, context=context)
    File "/home/odoo/runbot/static/openerp-dev-trunk-21183/server/openerp/addons/mail/mail_message.py", line 196, in _message_dict_get
      is_author = uid == msg.author_id.user_ids[0].id
  IndexError: list index out of range

  
  You can test directly on runbot:

  http://trunk_21183.runbot.openerp.com/?#action=490

  
  Important.

  This kind of bugs are really for newies ;-)

  Avoid:

      is_author = uid == msg.author_id.user_ids[0].id

  Always test first before selct a iterable.

  This expresion should be:

      is_author = uid == msg.author_id and msg.author_id.user_ids and
  msg.author_id.user_ids[0].id or WHATEVERAVOINDEXPLOSION

  Regards.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1062634/+subscriptions


References