[FIX] website_sale: change view for new qweb security access
authorChristophe Matthieu <chm@openerp.com>
Wed, 9 Oct 2013 12:48:48 +0000 (14:48 +0200)
committerChristophe Matthieu <chm@openerp.com>
Wed, 9 Oct 2013 12:48:48 +0000 (14:48 +0200)
bzr revid: chm@openerp.com-20131009124848-1n3eiy7dbew6j2js

addons/website_sale/controllers/main.py
addons/website_sale/views/website_sale.xml

index 2144df4..789391c 100644 (file)
@@ -259,6 +259,7 @@ class Ecommerce(http.Controller):
             'search': post.get("search"),
             'pager': pager,
             'styles': styles,
+            'style_in_product': lambda style, product: style.id in [s.id for s in product.website_style_ids]
         }
         return request.website.render("website_sale.products", values)
 
index 1c096ec..3b567b6 100644 (file)
                                           <a tabindex="-1" href="#">Styles</a>
                                           <ul class="dropdown-menu" name="style">
                                             <t t-foreach="styles" t-as="style">
-                                              <li t-att-class="style.id in [s.id for s in product.website_style_ids] and 'active' or ''"><a href="#" t-att-data-id="style.id" t-att-data-class="style.html_class"><t t-esc="style.name"/></a></li>
+                                              <li t-att-class="style_in_product(style, product) and 'active' or ''"><a href="#" t-att-data-id="style.id" t-att-data-class="style.html_class"><t t-esc="style.name"/></a></li>
                                             </t>
                                           </ul>
                                         </li>