[FIX] Survey : traceback when click on answer survey

lp bug: https://launchpad.net/bugs/1048954 fixed

bzr revid: hsa@tinyerp.com-20120912061252-qul9z1eycawtgu4b
This commit is contained in:
Hardik
2012-09-12 11:42:52 +05:30
parent f1f23c52ea
commit 6f0b0355df
+6 -2
View File
@@ -145,10 +145,14 @@ class survey(osv.osv):
return report
def fill_survey(self, cr, uid, ids, context=None):
sur_obj = self.read(cr, uid, ids,['title'], context=context)
sur_obj = self.read(cr, uid, ids,['title', 'page_ids'], context=context)
for sur in sur_obj:
name = sur['title']
context.update({'active':False,'survey_id': ids[0]})
pages = sur['page_ids']
if not pages:
raise osv.except_osv(_('Warning!'), _('You have to create question and answer for survey.'))
else:
context.update({'active':False,'survey_id': ids[0]})
return {
'view_type': 'form',
'view_mode': 'form',