[IMP] survey: inline, thanks message
bzr revid: chm@openerp.com-20130228153344-zql9lph55tylkugd
This commit is contained in:
@@ -198,7 +198,7 @@ class survey(osv.osv):
|
||||
|
||||
id = ids[0]
|
||||
survey = self.browse(cr, uid, id, context=context)
|
||||
context.update({'edit': False, 'survey_id': id, 'survey_token': survey.token})
|
||||
context.update({'edit': False, 'survey_id': id, 'survey_token': survey.token, 'ir_actions_act_window_target': 'inline'})
|
||||
return {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
|
||||
@@ -1166,12 +1166,13 @@ class survey_question_wiz(osv.osv_memory):
|
||||
|
||||
ir_model_data = self.pool.get('ir.model.data')
|
||||
user_browse = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context=context)
|
||||
model_id = ir_model_data.get_object_reference(cr, uid, 'portal', 'group_anonymous')
|
||||
anonymous = model_id and model_id[1] in [x.id for x in user_browse.groups_id]
|
||||
if anonymous:
|
||||
model, view_id = ir_model_data.get_object_reference(cr, uid, 'survey', 'view_survey_complete_survey_anonymous')
|
||||
else:
|
||||
model_id = ir_model_data.get_object_reference(cr, uid, 'base', 'group_user')
|
||||
employee = model_id and model_id[1] in [x.id for x in user_browse.groups_id]
|
||||
|
||||
if employee:
|
||||
model, view_id = ir_model_data.get_object_reference(cr, uid, 'survey', 'view_survey_complete_survey')
|
||||
else:
|
||||
model, view_id = ir_model_data.get_object_reference(cr, uid, 'survey', 'view_survey_complete_survey_external')
|
||||
|
||||
self._survey_complete(cr, uid, context['survey_id'], context)
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_survey_complete_survey_anonymous" model="ir.ui.view">
|
||||
<record id="view_survey_complete_survey_external" model="ir.ui.view">
|
||||
<field name="name">Complete Survey Answer</field>
|
||||
<field name="model">survey.question.wiz</field>
|
||||
<field name="priority">2</field>
|
||||
|
||||
Reference in New Issue
Block a user