[IMP] website_crm

bzr revid: chm@openerp.com-20130702160305-iffdvxsqkoczckzh
This commit is contained in:
Christophe Matthieu 2013-07-02 18:03:05 +02:00
parent 7885fd0fea
commit 42f1bdbd87
4 changed files with 8 additions and 6 deletions

View File

@ -2,6 +2,7 @@
import openerp
from openerp.addons.web import http
from openerp.addons.web.controllers.main import manifest_list
from urllib import quote_plus
from openerp.addons.web.http import request
def template_values():
@ -41,11 +42,14 @@ class Website(openerp.addons.web.controllers.main.Home):
'inherit_branding': editable
}
values = template_values()
company = request.registry['res.company'].browse(request.cr, uid, 1, context=context)
values.update({
'uid': uid,
'editable': editable,
'res_company': request.registry['res.company'].browse(request.cr, uid, 1, context=context),
'res_company': company,
})
values['google_map_url'] = "http://maps.googleapis.com/maps/api/staticmap?center=%s&sensor=false&zoom=8&size=298x298" \
% quote_plus('%s, %s %s, %s' % (company.street, company.city, company.zip, company.country_id and company.country_id.name_get()[0][1] or ''))
html = request.registry.get("ir.ui.view").render(request.cr, uid, path, values, context)
return html

View File

@ -122,12 +122,12 @@
<strong t-esc="res_company.name">Name</strong><br/>
<t t-esc="res_company.street"/><br/>
<t t-esc="res_company.city"/>, <t t-esc="res_company.zip"/><br/>
Belgium<br/>
<t t-esc="res_company.country_id and res_company.country_id.name_get()[0][1]"/><br/>
<br/>
&amp;#x2706; <t t-esc="res_company.phone"/><br/>
<i class="icon-envelope"></i> <t t-esc="res_company.email"/>
</address>
<a href="/"><img src="http://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&amp;zoom=13&amp;size=298x298&amp;sensor=false"/></a>
<img t-att-src="google_map_url"/>
</div>
</div>
</div>

View File

@ -4,8 +4,6 @@ import openerp
import simplejson
from openerp.addons.web import http
from openerp.addons.web.http import request
from werkzeug.exceptions import NotFound
import urllib
from openerp.addons.website.controllers.main import template_values

View File

@ -159,7 +159,7 @@
<t t-call="website_sale.page">
<t t-set="title">Your informations</t>
<t t-set="shop_content">
<form action="/shop/confirm_cart" method="post" enctype="x-www-form-urlencoded">
<form action="/shop/confirm_cart" method="post">
<div>Please enter your informations</div>
<input name="name" required="True" placeholder="Name..." t-att-value="partner and partner.name or ''"/><br/>
<input name="phone" type="tel" required="True" placeholder="Phone number..." t-att-value="partner and partner.phone or ''"/>