Mariano Ruiz - EOC has proposed merging 
lp:~eoc/openobject-addons/eoc-extra-addons-fix-bug1240243-product_variant into 
lp:~eoc/openobject-addons/eoc-extra-addons-trunk.

Requested reviews:
  Martin Collins (mkc-steadfast)

For more details, see:
https://code.launchpad.net/~eoc/openobject-addons/eoc-extra-addons-fix-bug1240243-product_variant/+merge/209830

Fix bug #1240243
-- 
https://code.launchpad.net/~eoc/openobject-addons/eoc-extra-addons-fix-bug1240243-product_variant/+merge/209830
Your team Enterprise Objects Consulting is subscribed to branch 
lp:~eoc/openobject-addons/eoc-extra-addons-trunk.
=== modified file 'product_variant_multi/__openerp__.py'
--- product_variant_multi/__openerp__.py	2014-02-25 23:04:56 +0000
+++ product_variant_multi/__openerp__.py	2014-03-07 03:36:37 +0000
@@ -21,7 +21,7 @@
 ##############################################################################
 {
     "name" : "Products with multi-level variants",
-    "version" : "1.0.1",
+    "version" : "1.0.2",
     "author" : "Tiny, Akretion, fixed by Enterprise Objects Consulting",
     "website" : "http://www.eoconsulting.com.ar";,
     "category" : "Generic Modules/Inventory Control",

=== modified file 'product_variant_multi/product_variant.py'
--- product_variant_multi/product_variant.py	2014-02-27 04:13:47 +0000
+++ product_variant_multi/product_variant.py	2014-03-07 03:36:37 +0000
@@ -65,7 +65,7 @@
         if context.get('product_tmpl_id', False):
             return super(product_variant_dimension_type, self).name_search(cr, uid, '', args, 'ilike', None, None)
         else:
-            return super(product_variant_dimension_type, self).name_search(cr, uid, '', None, 'ilike', None, None)
+            return super(product_variant_dimension_type, self).name_search(cr, uid, name, None, 'ilike', None, None)
 
 product_variant_dimension_type()
 
@@ -281,10 +281,10 @@
             res = {}
             temp_val_list = []
             for value in product_temp.value_ids:
-                if res.get(value.dimension_id, False):
-                    res[value.dimension_id] += [value.id]
+                if res.get(value.option_id.dimension_id, False):
+                    res[value.option_id.dimension_id] += [value.id]
                 else:
-                    res[value.dimension_id] = [value.id]
+                    res[value.option_id.dimension_id] = [value.id]
             for dim in res:
                 temp_val_list += [res[dim] + (not dim.mandatory_dimension and [None] or [])]
 
@@ -481,11 +481,11 @@
         inherit this function to hack the code generation'''
         product = self.browse(cr, uid, product_id, context=context)
         model = product.variant_model_name
-        r = map(lambda dim: [dim.dimension_id.sequence,
-                             self.parse(cr, uid, dim, model, context=context)],
-                product.dimension_value_ids)
+        r = map(lambda dim: [dim.option_id.dimension_id.sequence,
+                    dim.dimension_id.sequence, self.parse(cr, uid, dim, model, context=context)],
+                    product.dimension_value_ids)
         r.sort()
-        r = [x[1] for x in r]
+        r = [x[2] for x in r]
         new_variant_name = (product.variant_model_name_separator or '').join(r)
         return new_variant_name
 

-- 
Mailing list: https://launchpad.net/~zoook-community
Post to     : zoook-community@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zoook-community
More help   : https://help.launchpad.net/ListHelp

Reply via email to