Devishree Brahmbhatt (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-819257-dbr into
lp:openobject-addons.
Requested reviews:
Bhumika (OpenERP) (sbh-openerp)
Related bugs:
Bug #819257 in OpenERP Addons: "[TRUNK] TypeError: object of type 'int' has
no len()"
https://bugs.launchpad.net/openobject-addons/+bug/819257
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-819257-dbr/+merge/70256
Hello Ma'am,
Fixes the problem of : TypeError: object of type 'int' has no len()
Thanks.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-819257-dbr/+merge/70256
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-819257-dbr.
=== modified file 'survey/survey.py'
--- survey/survey.py 2011-07-01 23:41:24 +0000
+++ survey/survey.py 2011-08-03 06:37:30 +0000
@@ -92,7 +92,7 @@
def survey_cancel(self, cr, uid, ids, arg):
self.write(cr, uid, ids, {'state': 'cancel' })
return True
-
+
def copy(self, cr, uid, ids, default=None, context=None):
vals = {}
current_rec = self.read(cr, uid, ids, context=context)
@@ -181,9 +181,7 @@
if context is None:
context = {}
data = super(survey_page, self).default_get(cr, uid, fields, context)
- if context.get('line_order',False):
- if len(context['line_order'][-1]) > 2 and type(context['line_order'][-1][2]) == type({}) and context['line_order'][-1][2].has_key('sequence'):
- data['sequence'] = context['line_order'][-1][2]['sequence'] + 1
+ self.pool.get('survey.question').data_get(cr,uid,data,context)
if context.has_key('survey_id'):
data['survey_id'] = context.get('survey_id', False)
return data
@@ -504,14 +502,21 @@
'context': context
}
+ def data_get(self, cr, uid, data, context):
+ if data and context:
+ if context.get('line_order',False) and data.get('sequence',0):
+ lines = context.get('line_order')
+ seq = data['sequence']
+ for line in lines:
+ seq = seq + 1
+ data.update({'sequence': str(seq)})
+ return data
+
def default_get(self, cr, uid, fields, context=None):
if context is None:
context = {}
data = super(survey_question, self).default_get(cr, uid, fields, context)
- if context.get('line_order',False):
- if len(context['line_order'][-1]) > 2 and type(context['line_order'][-1][2]) == type({}) and context['line_order'][-1][2].has_key('sequence'):
- data['sequence'] = context['line_order'][-1][2]['sequence'] + 1
-
+ a=self.data_get(cr,uid,data,context)
if context.has_key('page_id'):
data['page_id']= context.get('page_id', False)
return data
@@ -604,9 +609,7 @@
if context is None:
context = {}
data = super(survey_answer, self).default_get(cr, uid, fields, context)
- if context.get('line_order', False):
- if len(context['line_order'][-1]) > 2 and type(context['line_order'][-1][2]) == type({}) and context['line_order'][-1][2].has_key('sequence'):
- data['sequence'] = context['line_order'][-1][2]['sequence'] + 1
+ self.pool.get('survey.question').data_get(cr,uid,data,context)
return data
survey_answer()
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp