← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 819257] Re: [TRUNK] TypeError: object of type 'int' has no len()

 

** Changed in: openobject-addons
   Importance: Undecided => Medium

** Changed in: openobject-addons
       Status: New => Confirmed

** Changed in: openobject-addons
     Assignee: (unassigned) => OpenERP R&D Addons Team 1 (openerp-dev-addons1)

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/819257

Title:
  [TRUNK] TypeError: object of type 'int' has no len()

Status in OpenERP Modules (addons):
  Confirmed

Bug description:
  Using server, web-client and addons from trunk on Ubuntu 11.04 with
  python2.6, I installed survey module.

  In Tools > Surveys > Define Surveys > Surveys, I choose any survey and
  whey I try to create a question, I get:

  [2011-07-29 15:03:55,180][?] ERROR:web-services:Uncaught exception
  Traceback (most recent call last):
    File "/home/max/openerp/server/trunk/openerp/osv/osv.py", line 118, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/home/max/openerp/server/trunk/openerp/osv/osv.py", line 172, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/home/max/openerp/server/trunk/openerp/osv/osv.py", line 163, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/max/openerp/addons/trunk/survey/survey.py", line 512, in default_get
      if len(context['line_order'][-1]) > 2 and type(context['line_order'][-1][2]) == type({}) and context['line_order'][-1][2].has_key('sequence'):
  TypeError: object of type 'int' has no len()
  > /home/max/openerp/addons/trunk/survey/survey.py(512)default_get()
  -> if len(context['line_order'][-1]) > 2 and type(context['line_order'][-1][2]) == type({}) and context['line_order'][-1][2].has_key('sequence'):

  
  (Pdb) l
  507 def default_get(self, cr, uid, fields, context=None):
  508 if context is None:
  509 context = {}
  510 data = super(survey_question, self).default_get(cr, uid, fields, context)
  511 if context.get('line_order',False):
  512 ->	 if len(context['line_order'][-1]) > 2 and type(context['line_order'][-1][2]) == type({}) and context['line_order'][-1][2].has_key('sequence'):
  513 data['sequence'] = context['line_order'][-1][2]['sequence'] + 1
  514
  515 if context.has_key('page_id'):
  516 data['page_id']= context.get('page_id', False)
  517 return data
  (Pdb) context['line_order'][-1]
  62

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


References