← Back to team overview

openerp-india team mailing list archive

[Bug 996565] [NEW] Survey doesn't generate the right report

 

Public bug reported:

When generating a PDF from an applicant survey, the addon fetches the
wrong information from the database.

The problem seems to be that the class 'survey_browse_response' expects
a list in context['response_id']:

  elif context.has_key('response_id') and context['response_id']:
  response_id = [int(context['response_id'][0])]

but 'survey_question_wiz.fields_view_get', where that key/value is
initialized, sets a string with integer:

  response_id = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))['response']
  context.update({'response_id':response_id})

Then what happens is that the string gets treated as a list, so only the
first digit is read. Changing the last line to

  context.update({'response_id': [response_id] })

fixes it.

** Affects: openobject-addons
     Importance: Undecided
         Status: New

** Description changed:

  When generating a PDF from an applicant survey, the addon fetches the
  wrong information from the database.
  
  The problem seems to be that the class 'survey_browse_response' expects
  a list in context['response_id']:
  
-             elif context.has_key('response_id') and context['response_id']:
-             response_id = [int(context['response_id'][0])]
+             elif context.has_key('response_id') and context['response_id']:
+             response_id = [int(context['response_id'][0])]
  
  but 'survey_question_wiz.fields_view_get', where that key/value is
  initialized, sets a string with integer:
  
-             response_id = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))['response']
-             context.update({'response_id':response_id})
+             response_id = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))['response']
+             context.update({'response_id':response_id})
  
  Then what happens is that the string gets treated as a list, so only the
  first digit is read. Changing the last line to
  
-             context.update({'response_id': [response_id] })
+             context.update({'response_id': [response_id] })
  
  fixes it.

** Description changed:

  When generating a PDF from an applicant survey, the addon fetches the
  wrong information from the database.
  
  The problem seems to be that the class 'survey_browse_response' expects
  a list in context['response_id']:
  
-             elif context.has_key('response_id') and context['response_id']:
-             response_id = [int(context['response_id'][0])]
+   elif context.has_key('response_id') and context['response_id']:
+   response_id = [int(context['response_id'][0])]
  
  but 'survey_question_wiz.fields_view_get', where that key/value is
  initialized, sets a string with integer:
  
-             response_id = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))['response']
-             context.update({'response_id':response_id})
+   response_id = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))['response']
+   context.update({'response_id':response_id})
  
  Then what happens is that the string gets treated as a list, so only the
  first digit is read. Changing the last line to
  
-             context.update({'response_id': [response_id] })
+   context.update({'response_id': [response_id] })
  
  fixes it.

-- 
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/996565

Title:
  Survey doesn't generate the right report

Status in OpenERP Addons (modules):
  New

Bug description:
  When generating a PDF from an applicant survey, the addon fetches the
  wrong information from the database.

  The problem seems to be that the class 'survey_browse_response'
  expects a list in context['response_id']:

    elif context.has_key('response_id') and context['response_id']:
    response_id = [int(context['response_id'][0])]

  but 'survey_question_wiz.fields_view_get', where that key/value is
  initialized, sets a string with integer:

    response_id = surv_name_wiz.read(cr, uid, context.get('sur_name_id',False))['response']
    context.update({'response_id':response_id})

  Then what happens is that the string gets treated as a list, so only
  the first digit is read. Changing the last line to

    context.update({'response_id': [response_id] })

  fixes it.

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


Follow ups

References