[MERGE]Merge lp:~openerp-dev/openobject-addons/trunk-website-al.

bzr revid: bth@tinyerp.com-20130823133638-9mwes61mqvl546qz
This commit is contained in:
bth-openerp
2013-08-23 19:06:38 +05:30
10 changed files with 252 additions and 94 deletions
+13 -4
View File
@@ -156,6 +156,7 @@
background-color: black;
border: 2px solid;
border-radius: 10px;
border-color: #1a1a1a;
margin: auto;
position: absolute;
top: 0;
@@ -164,17 +165,24 @@
right: 0;
max-width: 330px;
}
#mobile-preview .modal-header {
#mobile-preview.modal .modal-header {
background-color: black;
border-bottom: 0;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#mobile-preview .modal-body {
#mobile-preview.modal .modal-header .oe_mobile_preview_title {
color: #1a1a1a;
}
#mobile-preview.modal .modal-body {
background-color: black;
max-height: 600px;
padding: 0;
margin: 0;
}
#mobile-preview.modal .modal-footer {
background-color: black;
}
.oe_mobile_viewport {
width: 320px;
@@ -188,5 +196,6 @@
opacity: 1;
}
.oe_mobile_preview_header .close:hover {
color: darkgrey;
color: #e00101;
opacity: 1;
}
+13 -4
View File
@@ -132,11 +132,15 @@
height: 100%
overflow: hidden
$mobile_preview_background: #000000
$mobile_preview_border: #1A1A1A
$mobile_preview_close: #E00101
#mobile-preview.modal
height: 660px
background-color: black
background-color: $mobile_preview_background
border: 2px solid
border-radius: 10px
border-color: $mobile_preview_border
margin: auto
position: absolute
top: 0
@@ -144,16 +148,20 @@
bottom: 0
right: 0
max-width: 330px
#mobile-preview
.modal-header
background-color: $mobile_preview_background
border-bottom: 0
border-top-left-radius: 10px
border-top-right-radius: 10px
.oe_mobile_preview_title
color: $mobile_preview_border
.modal-body
background-color: $mobile_preview_background
max-height: 600px
padding: 0
margin: 0
.modal-footer
background-color: $mobile_preview_background
.oe_mobile_viewport
width: 320px
@@ -166,4 +174,5 @@
color: lightgrey
opacity: 1
.close:hover
color: darkgrey
color: $mobile_preview_close
opacity: 1
+3 -3
View File
@@ -40,12 +40,12 @@
</nav>
<div id="mobile-preview" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="mobile-preview-title" aria-hidden="true">
<div class="modal-header oe_mobile_preview_header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="mobile-preview-title">Preview</h3>
<button title="Close" type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="mobile-preview-title" class="oe_mobile_preview_title">Mobile preview</h3>
</div>
<div class="modal-body">
<div class="oe_mobile_preview">
<iframe id="mobile-viewport" class="oe_mobile_viewport" src="#"></iframe>
<iframe id="mobile-viewport" class="oe_mobile_viewport" src="?mobile-preview=true"></iframe>
</div>
</div>
</div>
+28 -5
View File
@@ -6,24 +6,47 @@ from openerp.addons.web.http import request
class website_contract(http.Controller):
@http.route(['/references/'], type='http', auth="public")
def blog(self, **post):
@http.route(['/references/', '/references/page/<int:page>/'], type='http', auth="public")
def references(self, page=0, **post):
website = request.registry['website']
partner_obj = request.registry['res.partner']
account_obj = request.registry['account.analytic.account']
domain = []
if post.get('search'):
domain += ['|',
('name', 'ilike', "%%%s%%" % post.get("search")),
('website_description', 'ilike', "%%%s%%" % post.get("search"))]
# public partner profile
partner_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID, [('website_testimonial', "!=", False), ('website_published', '=', True)])
partner_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID, domain + [('website_published', '=', True)])
if request.uid != website.get_public_user().id:
contract_ids = account_obj.search(request.cr, openerp.SUPERUSER_ID, [(1, "=", 1)])
contract_project_ids = [contract.partner_id.id
for contract in account_obj.browse(request.cr, openerp.SUPERUSER_ID, contract_ids) if contract.partner_id]
# search for check access rules
partner_ids += partner_obj.search(request.cr, request.uid, ['|', ('id', "in", contract_project_ids), ('id', "child_of", contract_project_ids)])
partner_ids += partner_obj.search(request.cr, request.uid, domain + ['|', ('id', "in", contract_project_ids), ('id', "child_of", contract_project_ids)])
partner_ids = list(set(partner_ids))
step = 20
pager = website.pager(url="/references/", total=len(partner_ids), page=page, step=step, scope=7, url_args=post)
partner_ids = partner_obj.search(request.cr, request.uid, [('id', 'in', partner_ids)], limit=step, offset=pager['offset'])
values = website.get_rendering_context({
'partner_ids': partner_obj.browse(request.cr, openerp.SUPERUSER_ID, partner_ids)
'partner_ids': partner_obj.browse(request.cr, openerp.SUPERUSER_ID, partner_ids),
'pager': pager,
'search': post.get("search"),
})
return website.render("website_contract.index", values)
@http.route(['/references/<int:ref_id>/'], type='http', auth="public")
def references_ref(self, ref_id=0, **post):
website = request.registry['website']
partner_obj = request.registry['res.partner']
values = website.get_rendering_context({
'partner_id': partner_obj.browse(request.cr, openerp.SUPERUSER_ID, ref_id, context={'show_address': True}),
})
return website.render("website_contract.details", values)
@@ -13,31 +13,99 @@
<!-- Page -->
<template id="index" name="Projects">
<template id="layout" name="References Layout">
<t t-call="website.layout">
<t t-set="title">References</t>
<div class="container">
<h1>Testimonial</h1>
<div class="thumbnails grid grid-align-top">
<div t-foreach="partner_ids" t-as="partner" class="span6">
<div class="media thumbnail">
<a class="pull-left" href="#">
<img class="media-object" t-att-src="partner.img('image_small')"/>
</a>
<div class="media-body">
<t t-call="website.publish"><t t-set="object" t-value="partner"/></t>
<h5 class="media-heading" t-field="partner.name"/>
<pre t-field="partner.website_testimonial"/>
<small t-field="partner.country_id"/>
<small t-field="partner.parent_id"/>
</div>
</div>
</div>
<div class="row">
<t t-raw="ref_content" />
</div>
</div>
</t>
</template>
<template id="index" name="References">
<t t-call="website_contract.layout">
<t t-set="ref_content">
<h1 class="span12 text-center">Trusted by millions worldwide</h1>
<h2 class="span12 text-center">Our public references</h2>
<div class="span12" id="ref_content">
<div class='navbar navbar-inverse'>
<div class='navbar-inner'>
<t t-call="website.pager" >
<t t-set="classname">pull-left</t>
</t>
<form action="/references/" method="get" class="navbar-search pull-right pagination">
<input type="text" name="search" class="search-query span2" placeholder="Search" t-att-value="search or '' or ''"/>
</form>
</div>
</div>
<div>
<div t-foreach="partner_ids" t-as="partner" class="media thumbnail">
<a class="pull-left" t-attf-href="/references/#{ partner.id }/">
<img class="media-object" t-att-src="partner.img('image_small')"/>
</a>
<div class="media-body">
<t t-call="website.publish"><t t-set="object" t-value="partner"/></t>
<a class="media-heading" t-attf-href="/references/#{ partner.id }/"><small t-field="partner.parent_id"/> <small t-field="partner.name"/></a>
<div t-field="partner.website_sort_description"/>
</div>
</div>
</div>
</div>
</t>
</t>
</template>
<template id="ref_country" inherit_id="website_contract.index" inherit_option_id="website_contract.index" name="Left Country Categories">
<xpath expr="//div[@id='ref_content']" position="before">
<div class="span4">
<ul class="nav nav-list">
<li class="nav-header">Location</li>
<!--t t-foreach="countries">
<li t-if="country_id" t-att-class="searches.get('country') == str(country_id and country_id[0]) and 'active' or ''">
<a t-attf-href="/event/#{ search_path }&amp;country=#{ country_id[0] }"><t t-esc="country_id[1]"/><small>(<t t-esc="country_id_count"/>)</small></a>
</li>
</t-->
</ul>
</div>
</xpath>
<xpath expr="//div[@id='ref_content']" position="attributes">
<attribute name="class">span8</attribute>
</xpath>
</template>
<template id="details" name="Reference Detail">
<t t-call="website_contract.layout">
<t t-set="ref_content">
<t t-call="website.publish"><t t-set="object" t-value="partner_id"/></t>
<h1 class="span12 text-center" t-field="partner_id.name"/>
<div class="span4">
<div class="text-center">
<img t-att-src="partner_id.img('image_medium')"/>
</div>
<address>
<table style="margin: auto;" class="well">
<colgroup>
<col width="100"/>
<col/>
</colgroup>
<tbody>
<t t-set="address" t-value="'&lt;br/&gt;'.join(partner_id.name_get()[0][1].split('\n')[1:])"/>
<tr t-if="address or editable"><th>Address</th><td class="span2" t-raw="address"/></tr>
<tr t-if="partner_id.website or editable"><th>Website</th><td class="span2" t-field="partner_id.website"/></tr>
<tr t-if="partner_id.phone or editable"><th>Tel</th><td class="span2" t-field="partner_id.phone"/></tr>
<tr t-if="partner_id.mobile or editable"><th>Tel</th><td class="span2" t-field="partner_id.mobile"/></tr>
<tr t-if="partner_id.fax or editable"><th>Fax</th><td class="span2" t-field="partner_id.fax"/></tr>
<tr t-if="partner_id.email or editable"><th>Email</th><td class="span2" t-field="partner_id.email"/></tr>
</tbody>
</table>
</address>
</div>
<div class="span8 mt32" t-field="partner_id.website_description"/>
</t>
</t>
</template>
</data>
</openerp>
+2 -1
View File
@@ -6,7 +6,8 @@ class res_partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'website_published': fields.boolean('Available in the website'),
'website_testimonial': fields.text('Recommandation'),
'website_description': fields.html('Description for the website'),
'website_sort_description': fields.text('Sort description for the website'),
}
def img(self, cr, uid, ids, field='image_small', context=None):
+66 -34
View File
@@ -27,16 +27,14 @@ def get_order(order_id=None):
context = {
'pricelist': order.pricelist_id.id,
'partner': order.partner_id.id,
}
return order_obj.browse(request.cr, SUPERUSER_ID, order_id, context=context)
def get_current_order():
order = get_order(request.httprequest.session.get('ecommerce_order_id'))
if order.state != 'draft':
order = get_order()
request.httprequest.session['ecommerce_order_id'] = order.id
return order
if request.httprequest.session.get('ecommerce_order_id'):
return get_order(request.httprequest.session.get('ecommerce_order_id'))
else:
return False
class website(osv.osv):
_inherit = "website"
@@ -60,6 +58,9 @@ class Ecommerce(http.Controller):
@http.route(['/shop/', '/shop/category/<cat_id>/', '/shop/category/<cat_id>/page/<int:page>/', '/shop/page/<int:page>/'], type='http', auth="public")
def category(self, cat_id=0, page=0, **post):
if 'promo' in post:
self.change_pricelist(post.get('code'))
website = request.registry['website']
product_obj = request.registry.get('product.template')
@@ -71,7 +72,7 @@ class Ecommerce(http.Controller):
domain += ['|', '|', '|',
('name', 'ilike', "%%%s%%" % post.get("search")),
('description', 'ilike', "%%%s%%" % post.get("search")),
('description_website', 'ilike', "%%%s%%" % post.get("search")),
('website_description', 'ilike', "%%%s%%" % post.get("search")),
('product_variant_ids.pos_categ_id.name', 'ilike', "%%%s%%" % post.get("search"))]
if cat_id:
cat_id = int(cat_id)
@@ -81,12 +82,14 @@ class Ecommerce(http.Controller):
product_count = len(product_obj.search(request.cr, request.uid, domain))
pager = website.pager(url="/shop/category/%s/" % cat_id, total=product_count, page=page, step=step, scope=7, url_args=post)
product_ids = product_obj.search(request.cr, request.uid, domain, limit=step, offset=pager['offset'], order="website_published,name")
product_ids = product_obj.search(request.cr, request.uid, domain, limit=step, offset=pager['offset'])
context = request.httprequest.session.get('ecommerce_context', {})
values = website.get_rendering_context({
'categories': self.get_categories(),
'category_id': cat_id,
'products': product_obj.browse(request.cr, request.uid, product_ids),
'products': product_obj.browse(request.cr, request.uid, product_ids, context=context),
'search': post.get("search"),
'pager': pager,
})
@@ -94,12 +97,16 @@ class Ecommerce(http.Controller):
@http.route(['/shop/product/<product_id>/'], type='http', auth="public")
def product(self, cat_id=0, product_id=0, **post):
if 'promo' in post:
self.change_pricelist(post.get('code'))
website = request.registry['website']
product_id = product_id and int(product_id) or 0
product_obj = request.registry.get('product.template')
context = get_current_order()._context
context = request.httprequest.session.get('ecommerce_context', {})
product = product_obj.browse(request.cr, request.uid, product_id, context=context)
values = website.get_rendering_context({
@@ -110,17 +117,33 @@ class Ecommerce(http.Controller):
})
return website.render("website_sale.product", values)
def change_pricelist(self, code):
request.httprequest.session.setdefault('ecommerce_context', {})
order = get_current_order()
if order:
pricelist_obj = request.registry.get('product.pricelist')
pricelist_ids = pricelist_obj.search(request.cr, SUPERUSER_ID, [('code', '=', code)])
if pricelist_ids:
pricelist_id = pricelist_ids[0]
else:
pricelist_id = order.onchange_partner_id(request.uid, context={})['value']['pricelist_id']
request.httprequest.session['ecommerce_context']['pricelist'] = pricelist_id
values = {'pricelist_id': pricelist_id}
values.update(order.onchange_pricelist_id(pricelist_id, None)['value'])
order.write(values)
for line in order.order_line:
self.add_product_to_cart(line.product_id.id, 0)
@http.route(['/shop/mycart/'], type='http', auth="public")
def mycart(self, **post):
order = get_current_order()
website = request.registry['website']
prod_obj = request.registry.get('product.product')
if post.get('code'):
pricelist_obj = request.registry.get('product.pricelist')
pricelist_ids = pricelist_obj.search(request.cr, SUPERUSER_ID, [('code', '=', post.get('code'))])
if pricelist_ids:
order.write({'pricelist_id': pricelist_ids[0]})
if 'promo' in post:
self.change_pricelist(post.get('promo'))
suggested_ids = []
for line in order.order_line:
@@ -139,13 +162,16 @@ class Ecommerce(http.Controller):
return website.render("website_sale.mycart", values)
def add_product_to_cart(self, product_id=0, number=1, set_number=-1):
context = {}
context = request.httprequest.session.get('ecommerce_context', {})
order_line_obj = request.registry.get('sale.order.line')
user_obj = request.registry.get('res.users')
product_id = product_id and int(product_id) or 0
order = get_current_order()
if not order:
order = get_order()
request.httprequest.session['ecommerce_order_id'] = order.id
quantity = 0
@@ -158,27 +184,32 @@ class Ecommerce(http.Controller):
quantity = set_number
else:
quantity = order_line['product_uom_qty'] + number
if quantity <= 0:
order_line_obj.unlink(request.cr, SUPERUSER_ID, order_line_ids, context=context)
if quantity < 0:
quantity = 0
else:
fields = [k for k, v in order_line_obj._columns.items()]
values = order_line_obj.default_get(request.cr, SUPERUSER_ID, fields, context=context)
quantity = 1
values['product_uom_qty'] = quantity
values['product_id'] = product_id
values['order_id'] = order.id
# change and record value
if quantity > 0:
pricelist_id = order.pricelist_id and order.pricelist_id.id or False
values.update(order_line_obj.product_id_change(request.cr, SUPERUSER_ID, [], pricelist_id, product_id,
partner_id=user_obj.browse(request.cr, SUPERUSER_ID, request.uid).partner_id.id,
context=context)['value'])
if order_line_ids:
order_line_obj.write(request.cr, SUPERUSER_ID, order_line_ids, values, context=context)
else:
order_line_id = order_line_obj.create(request.cr, SUPERUSER_ID, values, context=context)
order.write({'order_line': [(4, order_line_id)]}, context=context)
pricelist_id = order.pricelist_id and order.pricelist_id.id or False
vals = order_line_obj.product_id_change(request.cr, SUPERUSER_ID, [], pricelist_id, product_id,
partner_id=user_obj.browse(request.cr, SUPERUSER_ID, request.uid).partner_id.id,
context=context)['value']
values.update(vals)
if order_line_ids:
order_line_obj.write(request.cr, SUPERUSER_ID, order_line_ids, values, context=context)
if not quantity:
order_line_obj.unlink(request.cr, SUPERUSER_ID, order_line_ids, context=context)
else:
order_line_id = order_line_obj.create(request.cr, SUPERUSER_ID, values, context=context)
order.write({'order_line': [(4, order_line_id)]}, context=context)
return quantity
@@ -319,7 +350,6 @@ class Ecommerce(http.Controller):
shipping_id = partner_obj.create(request.cr, SUPERUSER_ID, shipping_value)
order_value = {
'state': 'progress',
'partner_id': partner_id,
'partner_invoice_id': partner_id,
'partner_shipping_id': shipping_id or partner_id
@@ -327,17 +357,14 @@ class Ecommerce(http.Controller):
order_value.update(request.registry.get('sale.order').onchange_partner_id(request.cr, SUPERUSER_ID, [], request.uid, context={})['value'])
order.write(order_value)
request.httprequest.session['ecommerce_order_id_old'] = order.id
request.httprequest.session['ecommerce_order_id'] = None
return werkzeug.utils.redirect("/shop/payment/")
@http.route(['/shop/payment/'], type='http', auth="public")
def payment(self, **post):
website = request.registry['website']
order = get_order(request.httprequest.session.get('ecommerce_order_id_old'))
order = get_current_order()
if order.state != 'progress':
if not order or not order.order_line:
return self.mycart(**post)
values = website.get_rendering_context({
@@ -354,4 +381,9 @@ class Ecommerce(http.Controller):
return website.render("website_sale.payment", values)
@http.route(['/shop/payment_validate/'], type='http', auth="public")
def payment_validate(self, **post):
request.httprequest.session['ecommerce_order_id'] = False
return werkzeug.utils.redirect("/shop/")
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,13 +1,19 @@
$(document).ready(function () {
$(".oe_website_sale input[name='shipping_different']").change(function() {
$(".oe_website_sale input[name='shipping_different']").change(function () {
$(".oe_website_sale .js_shipping").toggle();
});
$(".oe_website_sale .oe_mycart input.js_quantity").change(function() {
$(".oe_website_sale .oe_mycart input.js_quantity").change(function () {
var value = parseInt($(this).val());
if (!isNaN(value)) {
window.location.href = window.location.origin + window.location.pathname + 'set_cart/' + $(this).data('id') + '/' + value + '/';
}
});
$payment = $(".oe_website_sale .js_payment");
$("input[name='payment_type']", $payment).click(function (ev) {
var payment_id = $(ev.target).val();
$("div[data-id]", $payment).addClass("hidden");
$("a.btn:last, div[data-id='"+payment_id+"']", $payment).removeClass("hidden");
});
});
+33 -23
View File
@@ -22,7 +22,7 @@
<a href="/shop/mycart/">
<i class="icon-shopping-cart"></i>
My cart
<t t-if="order.get_total_quantity()">
<t t-if="order and order.get_total_quantity()">
<span class="badge badge-success" t-esc="order.get_total_quantity()"/>
</t>
</a>
@@ -62,7 +62,7 @@
</div>
</t>
</template>
<template id="products_categories" inherit_id="website_sale.layout" inherit_option_id="website_sale.layout" name="Products Left Categories">
<template id="products_categories" inherit_id="website_sale.layout" inherit_option_id="website_sale.layout" name="Left Product Categories">
<xpath expr="//div[@id='shop_content']" position="before">
<div class="span4">
<ul class="nav nav-list">
@@ -116,9 +116,14 @@
</a>
<div>
<div t-field="product.description_sale"></div>
<div><span t-field="product.list_price"></span>€</div>
<div>
<t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
<small class="text-error" style="text-decoration: line-through;"><t t-esc="product.product_variant_ids[0].lst_price" /> €</small>
</t>
<b><t t-esc="product.product_variant_ids[0].price" /> €</b>
</div>
<div class="mb8 mt8">
<a t-attf-href="./add_cart/#{ product.id }/" class="btn btn-small btn-success">Add to cart</a>
<a t-if="product.website_published" t-attf-href="./add_cart/#{ product.id }/" class="btn btn-small btn-success">Add to cart</a>
</div>
</div>
</div>
@@ -157,7 +162,7 @@
<button class="btn btn-small btn-success">Add to cart</button>
</form>
<img class="media-object" t-att-src="product.img('image')"/>
<div t-field="product.description_website"></div>
<div t-field="product.website_description"></div>
<div>
<t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
<h5 class="text-error" style="text-decoration: line-through;"><t t-esc="product.product_variant_ids[0].lst_price" /> €</h5>
@@ -196,7 +201,7 @@
<t t-set="shop_content">
<div class="span8 oe_mycart">
<h2>My Shopping Cart</h2>
<table class='table table-hover' id="mycart_products">
<table class='table' id="mycart_products">
<colgroup>
<col width="80"/>
<col/>
@@ -220,16 +225,14 @@
<a t-attf-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/"><img class="img-rounded" t-att-src="line.product_id.img('image_small')"/></a>
</td>
<td>
<a t-attf-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/">
<span t-field="line.product_id.name"/> <t t-if="line.product_id.variants">(<small t-field="line.product_id.variants"/>)</t>
</a><br/>
<a t-attf-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/"><span t-field="line.name"/></a><br/>
<small t-field="line.product_id.description_sale"/>
</td>
<td>
<t t-if="line.product_id.lst_price != line.product_id.price">
<t t-if="line.product_id.lst_price != line.price_unit">
<small class="text-error" style="text-decoration: line-through;"><t t-esc="line.product_id.lst_price" /> €</small>
</t>
<span t-field="line.product_id.price"></span> €
<span t-field="line.price_unit"></span> €
</td>
<td>
<div class="mb8 mt8 pull-right">
@@ -253,12 +256,9 @@
<tr> <th colspan="3">Subtotal </th> <th><t t-esc="order.amount_untaxed"/> €</th></tr>
<tr> <th colspan="3">Taxes </th> <th><t t-esc="order.amount_tax"/> €</th></tr>
<tr> <th colspan="3"><h4>Total</h4></th> <th><h4><t t-esc="order.amount_total"/> €</h4></th></tr>
<tr>
<th colspan="4"><a t-if="order.order_line" href="/shop/checkout/" class="pull-right btn btn-success">Proceed To Payment</a></th>
</tr>
</thead>
</table>
<a t-if="order.order_line" href="/shop/checkout/" class="btn btn-success">Proceed To Payment</a>
</div>
</t>
</t>
@@ -319,7 +319,7 @@
<template id="reduction_code" inherit_option_id="website_sale.mycart" name="Reduction Code">
<xpath expr="//table[@id='mycart_total']" position="after">
<form t-if="order.order_line" class="well form-search" action="/shop/mycart/" method="post">
<input name="code" class='input' type="text" placeholder="Reduction Code..." t-att-value="order.pricelist_id.code"/>
<input name="promo" class='input' type="text" placeholder="Reduction Code..." t-att-value="order.pricelist_id.code or ''"/>
<button class="btn">Apply Code</button>
</form>
</xpath>
@@ -349,9 +349,9 @@
<tbody t-if="order.order_line">
<t t-foreach="order.order_line" t-as="line">
<tr>
<td><t t-esc="line.name"/> <t t-if="line.product_id.variants">(<small t-field="line.product_id.variants"/>)</t></td>
<td><t t-esc="line.name"/></td>
<td><t t-esc="line.product_uom_qty"/></td>
<td><t t-esc="line.product_id.list_price"/>€</td>
<td><t t-esc="line.price_unit"/> €</td>
</tr>
</t>
</tbody>
@@ -516,6 +516,10 @@
<template id="payment">
<t t-call="website.layout">
<t t-set="head">
<script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
<t t-raw="head or ''"/>
</t>
<t t-set="title">Shop - Payment</t>
<div class="container mt48 oe_website_sale">
<div class="row">
@@ -533,7 +537,7 @@
<tr>
<td><t t-esc="line.name"/></td>
<td><t t-esc="line.product_uom_qty"/></td>
<td><t t-esc="line.product_id.list_price"/>€</td>
<td><t t-esc="line.price_unit"/> €</td>
</tr>
</t>
</tbody>
@@ -545,13 +549,19 @@
</table>
</div>
<div class="span8">
<div class="row">
<div class="js_payment row">
<h3 class="span8">Click on your payment method</h3>
<div class="span2">
<t t-foreach="payments or []" t-as="payment">
<label>
<input t-att-value="payment.id" type="radio" name="payment_type"/> <t t-esc="payment.name"/>
</label>
</t>
</div>
<t t-foreach="payments or []" t-as="payment">
<div t-att-title="payment.name">
<t t-raw="payment._content"/>
</div>
<div t-att-data-id="payment.id" t-raw="payment._content" class="hidden span6"/>
</t>
<a href="/shop/payment_validate/" class="hidden btn">I validate my payment</a>
</div>
</div>
</div>
+1 -1
View File
@@ -32,7 +32,7 @@ class product_template(osv.osv):
_inherit = "product.template"
_columns = {
'website_published': fields.boolean('Available in the website'),
'description_website': fields.html('Description for the website'),
'website_description': fields.html('Description for the website'),
'suggested_product_id': fields.many2one('product.product', 'Suggested For Product'),
'suggested_product_ids': fields.one2many('product.product', 'suggested_product_id', 'Suggested Products'),
}