[FIX] website_sale: the order of the attribute list doesn't matter
authorDenis Ledoux <dle@odoo.com>
Wed, 10 Sep 2014 13:07:06 +0000 (15:07 +0200)
committerDenis Ledoux <dle@odoo.com>
Wed, 10 Sep 2014 13:08:34 +0000 (15:08 +0200)
addons/website_sale/static/src/js/website_sale.js

index 4ca9aa3..c497e07 100644 (file)
@@ -87,7 +87,7 @@ $(document).ready(function () {
         });
         var available = false;
         for (var k in variant_ids) {
-            if (_.isEqual(variant_ids[k][1], values)) {
+            if (_.isEmpty(_.difference(variant_ids[k][1], values))) {
                 var dec = variant_ids[k][2] % 1;
                 $('input[name="product_id"]').val(variant_ids[k][0]);
                 $price.html(variant_ids[k][2] + (dec < 0.01 ? ".00" : (dec < 1 ? "0" : "") ));