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

Bug #819257 reported by Maxime Chambreuil (http://www.savoirfairelinux.com)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 1

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

Tags: survey trunk

Related branches

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Hello,

Its fixed inlp:~openerp-dev/openobject-addons/trunk-bug-819257-dbr
branch. It will be merge soon with trunk addons.

Revision ID : 4903 <email address hidden>
Revision No: 4903

Thank You.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

Hello,

Can you please backport the fix to 6.0 ?

Thank you.

Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
qdp (OpenERP) (qdp) wrote :

fix released in trunk 5099

Revision history for this message
miaoulafrite (miaoulafrite) wrote :

hello,

just installed the 6.0 version and the bug is still there

has the fix been committed / released to the 6.0's branch?

thanks

Revision history for this message
miaoulafrite (miaoulafrite) wrote :

please do not mark it as "released" since it is not...
server 6.0.3 all fresh from this week (feb 2012) and bug is still there!
it is not possible to add any survey

Revision history for this message
qdp (OpenERP) (qdp) wrote :

Hello,

as per our bug management policy, we are only fixing and releasing bugs on the trunk version (which has been released last week under the name of 6.1). For stable versions, in particular the 6.0 serie you're working with, there are no automatic backport of our patches. If you want a bug to be fixed on a stable version, you must have an OpenERP Entreprise contract and contact our support channel.

thanks for your understanding,
Quentin

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.