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

[FIX] website_sale: accessory_product_ids are product.product, not product.template

This many2many field should actually have product.template as relation
But, in a stable release, we cannot alter the database
Therefore, when displaying accessory products in the card, it display the product_tmpl_id of the product.product, not itself
This relation should be changed in trunk
+ Actually displaying this field in the backend
parent b1c0bc0b
No related merge requests found
......@@ -111,7 +111,7 @@ 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.id for l in (order.website_order_line or []) for j in (l.product_id.accessory_product_ids or []))
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(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)
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment