[FIX] survey: trace the partner_id taking the survey; if no token, set as the current user's partner.

This commit is contained in:
jas 2014-07-25 11:48:15 +05:30 committed by Thibault Delavallée
parent 2ad607feec
commit d7ef283f53
1 changed files with 4 additions and 1 deletions

View File

@ -99,7 +99,10 @@ class WebsiteSurvey(http.Controller):
# Manual surveying
if not token:
user_input_id = user_input_obj.create(cr, uid, {'survey_id': survey.id}, context=context)
vals = {'survey_id': survey.id}
if request.website.user_id.id != uid:
vals['partner_id'] = request.registry['res.users'].browse(cr, uid, uid, context=context).partner_id.id
user_input_id = user_input_obj.create(cr, uid, vals, context=context)
user_input = user_input_obj.browse(cr, uid, [user_input_id], context=context)[0]
else:
try: