[FIX] website_sale: display accessory field in form view and display the good accessory product inside ecommerce

This commit is contained in:
Christophe Matthieu 2014-06-02 12:11:54 +02:00
parent e3bd7d953a
commit 3cc4785ba6
3 changed files with 4 additions and 3 deletions

View File

@ -114,7 +114,7 @@ class sale_order(osv.Model):
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'

View File

@ -727,14 +727,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>

View File

@ -25,6 +25,7 @@
<field name="public_categ_ids" widget="many2many_tags"/>
<field name="website_published" class="pull-right" widget="website_button"/>
<field name="alternative_product_ids" widget="many2many_tags"/>
<field name="accessory_product_ids" widget="many2many_tags"/>
<field name="website_style_ids" widget="many2many_tags"/>
<field name="website_sequence"/>
</group>