[FIX] survey: trace the partner_id taking the survey; if no token, set as the current user's partner.
This commit is contained in:
parent
2ad607feec
commit
d7ef283f53
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue