Skip to content
Snippets Groups Projects
Commit 48974287 authored by Denis Ledoux's avatar Denis Ledoux
Browse files

[FIX] website_sale: backport commit 3cc4785b of master

This fix aimed saas-5, not master.
original Commit message:
display accessory field in form view and display the good accessory product inside ecommerce
This is related to previous rev 86055fb8
parent 86055fb8
Branches
Tags
No related merge requests found
......@@ -111,10 +111,10 @@ class sale_order(osv.Model):
def _cart_accessories(self, cr, uid, ids, context=None):
for order in self.browse(cr, uid, ids, context=context):
s = set(j.product_tmpl_id.id for l in (order.website_order_line or []) for j in (l.product_id.accessory_product_ids or []))
s = set(j.id for l in (order.website_order_line or []) for j in (l.product_id.accessory_product_ids or []))
s -= set(l.product_id.id for l in order.order_line)
product_ids = random.sample(s, min(len(s),3))
return self.pool['product.template'].browse(cr, uid, product_ids, context=context)
return self.pool['product.product'].browse(cr, uid, product_ids, context=context)
class website(orm.Model):
_inherit = 'website'
......
......@@ -726,14 +726,14 @@
<tr t-foreach="suggested_products" t-as="product">
<td>
<a t-attf-href="/shop/product/#{ slug(product) }">
<a t-attf-href="/shop/product/#{ slug(product.product_tmpl_id) }">
<span t-field="product.image_small"
t-field-options='{"widget": "image", "class": "img-rounded"}'/>
</a>
</td>
<td>
<div>
<a t-attf-href="/shop/product/#{ slug(product) }">
<a t-attf-href="/shop/product/#{ slug(product.product_tmpl_id) }">
<strong t-field="product.name"/>
</a>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment