[FIX] website_crm: contact-us form
bzr revid: chm@openerp.com-20140107145400-32j6hgx8176llwxw
This commit is contained in:
parent
3f0f6b820b
commit
8d26804796
|
@ -3,6 +3,7 @@
|
|||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
from openerp.addons.website.models import website
|
||||
from openerp import SUPERUSER_ID
|
||||
|
||||
from urllib import quote_plus
|
||||
|
||||
|
@ -15,7 +16,7 @@ class contactus(http.Controller):
|
|||
)
|
||||
return url
|
||||
|
||||
@website.route(['/crm/contactus'], type='http', auth="admin", multilang=True)
|
||||
@website.route(['/crm/contactus'], type='http', auth="public", multilang=True)
|
||||
def contactus(self, *arg, **post):
|
||||
required_fields = ['contact_name', 'email_from', 'description']
|
||||
post['user_id'] = False
|
||||
|
@ -34,8 +35,7 @@ class contactus(http.Controller):
|
|||
if not post.get('name'):
|
||||
post['name'] = post.get('contact_name')
|
||||
|
||||
request.registry['crm.lead'].create(request.cr, request.uid,
|
||||
post, request.context)
|
||||
request.registry['crm.lead'].create(request.cr, SUPERUSER_ID, post, request.context)
|
||||
company = request.website.company_id
|
||||
values = {
|
||||
'google_map_url': self.generate_google_map_url(company.street, company.city, company.zip, company.country_id and company.country_id.name_get()[0][1] or '')
|
||||
|
|
|
@ -60,13 +60,13 @@
|
|||
<div id="wrap">
|
||||
<div class="oe_structure"/>
|
||||
<div class="container">
|
||||
<h1>Thanks!</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="alert alert-success">
|
||||
Your message has been sent successfully.
|
||||
<button type="button" class="close" data-dismiss="alert">&times;</button>
|
||||
</div>
|
||||
<h2>Thanks!</h2>
|
||||
<p>
|
||||
We will get back to you shortly.
|
||||
</p><p class="mt64">
|
||||
|
|
Loading…
Reference in New Issue