[FIX] survey: add page_id when using wizard

bzr revid: mat@openerp.com-20130611100243-r5u6eyoj2ppiifc2
This commit is contained in:
Martin Trigaux
2013-06-11 12:02:43 +02:00
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -502,7 +502,7 @@ class survey_question(osv.osv):
def create(self, cr, uid, vals, context=None):
minimum_ans = 0
maximum_ans = 0
page = self.pool.get('survey.page').browse(cr, uid, vals['page_id'], context=context).title
page = self.pool.get('survey.page').browse(cr, uid, int(vals.get('page_id', 0)), context=context).title
if vals.has_key('answer_choice_ids') and not len(vals['answer_choice_ids']):
if vals.has_key('type') and vals['type'] not in ['descriptive_text', 'single_textbox', 'comment','table']:
raise osv.except_osv(_('Warning!'),_('You must enter one or more answers for question "%s" of page %s .') % (vals['question'], page))
+1
View File
@@ -772,6 +772,7 @@
<field name="arch" type="xml">
<form string="Survey Question">
<field name="question" colspan="4"/>
<field name="page_id"/>
<field name="sequence"/>
<field name="tot_resp"/>
<field name="type" on_change="on_change_type(type)"/>
+1
View File
@@ -1036,6 +1036,7 @@ class survey_question_wiz(osv.osv_memory):
'type': 'ir.actions.act_window',
'target': 'new',
'view_id': view_id,
'page_id': int(context.get('page_id',0)),
'context': context
}