[FIX] website_sale_coupon: promotion program image

Before this commit, when using a promotion program ('I have a promo
code') in the shopping cart in the e-commerce, the image of the
promotion product is only shown if the user is connected.

opw-2056968

closes odoo/enterprise#5343

X-port/Cherry-pick of odoo/enterprise@88e1ab31d2

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit is contained in:
Jorge Pinna Puissant
2019-09-04 19:40:17 +02:00
committed by Christophe Simonis
parent 9570151cb5
commit dc5a8b1b30
@@ -7,6 +7,16 @@
</xpath>
</template>
<template id="website_sale_coupon_cart_hide_qty" inherit_id="website_sale.cart_lines" active="True">
<xpath expr="//td[hasclass('td-img')]/span" position="replace">
<t t-if="line.is_reward_line and line.sudo().product_id.image_small">
<span>
<img t-att-src="image_data_uri(line.sudo().product_id.image_small)" class="img img-fluid rounded" t-att-alt="line.name_short"/>
</span>
</t>
<t t-else="">
<t>$0</t>
</t>
</xpath>
<xpath expr="//td[hasclass('td-qty')]/div" position="attributes">
<attribute name="t-att-style">line.is_reward_line and "display:none;"</attribute>
</xpath>
@@ -24,6 +34,18 @@
<attribute name="t-if">not line.is_reward_line</attribute>
</xpath>
</template>
<template id="cart_popover" inherit_id="website_sale.cart_popover" name="Cart Popover">
<xpath expr="//div[hasclass('cart_line')]/div[1]/span" position="replace">
<t t-if="line.is_reward_line and line.sudo().product_id.image_small">
<span>
<img t-att-src="image_data_uri(line.sudo().product_id.image_small)" class="img img-fluid rounded" t-att-alt="line.name_short"/>
</span>
</t>
<t t-else="">
<t>$0</t>
</t>
</xpath>
</template>
<template id="sale_coupon_result" inherit_id="website_sale.coupon_form">
<xpath expr="//form[@name='coupon_code']" position="after">
<t t-if="website_sale_order and website_sale_order.applied_coupon_ids">