[FIX] website_crm: the path '/crm/contactus' have an error if you does'nt use the website contact form or if you reload the page, insead of redirect to contact form.

This commit is contained in:
Christophe Matthieu 2014-07-09 10:45:35 +02:00
parent e0ed658044
commit 6183fb105e
1 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class contactus(http.Controller):
post_file = [] # List of file to add to ir_attachment once we have the ID
post_description = [] # Info to add after the message
values = {'user_id': False}
values = {}
lead_model = request.registry['crm.lead']
@ -81,7 +81,7 @@ class contactus(http.Controller):
post_description.append("%s: %s" % ("REFERER", environ.get("HTTP_REFERER")))
values['description'] += dict_to_str(_("Environ Fields: "), post_description)
lead_id = lead_model.create(request.cr, SUPERUSER_ID, values, request.context)
lead_id = lead_model.create(request.cr, SUPERUSER_ID, dict(values, user_id=False), request.context)
if lead_id:
for field_value in post_file:
attachment_value = {