[MERGE] forward port branch saas-15 up to 333a58e4ef
This commit is contained in:
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<template id='recommended_product' inherit_id="website_sale.recommended_products" name="Alternative Products">
|
<template id='recommended_product' inherit_id="website_sale.recommended_products" name="Alternative Products">
|
||||||
<xpath expr="//h3" position="replace">
|
<xpath expr="//h3" position="replace">
|
||||||
<t t-set="ids" t-value="str(product.id) + ','+ ','.join([str(a) for a in product.alternative_product_ids.ids])"></t>
|
<t t-set="ids" t-value="str(product.product_variant_id.id) + ','+ ','.join([str(a) for a in product.alternative_product_ids.mapped('product_variant_id.id')])"/>
|
||||||
<div><span class='h3'>Suggested alternatives: </span><a class="btn btn-primary" t-attf-href="/shop/compare/?products=#{ids}"><i class="fa fa-exchange"></i> Compare</a></div>
|
<div><span class='h3'>Suggested alternatives: </span><a class="btn btn-primary" t-attf-href="/shop/compare/?products=#{ids}"><i class="fa fa-exchange"></i> Compare</a></div>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -348,6 +348,8 @@ class Slide(models.Model):
|
|||||||
|
|
||||||
def _get_embed_code(self):
|
def _get_embed_code(self):
|
||||||
base_url = request and request.httprequest.url_root or self.env['ir.config_parameter'].sudo().get_param('web.base.url')
|
base_url = request and request.httprequest.url_root or self.env['ir.config_parameter'].sudo().get_param('web.base.url')
|
||||||
|
if base_url[-1] == '/':
|
||||||
|
base_url = base_url[:-1]
|
||||||
for record in self:
|
for record in self:
|
||||||
if record.datas and (not record.document_id or record.slide_type in ['document', 'presentation']):
|
if record.datas and (not record.document_id or record.slide_type in ['document', 'presentation']):
|
||||||
slide_url = base_url + url_for('/slides/embed/%s?page=1' % record.id)
|
slide_url = base_url + url_for('/slides/embed/%s?page=1' % record.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user