Merge lp:~eoc/openobject-addons/eoc-extra-addons-fix-bug1240243-product_variant into lp:~eoc/openobject-addons/eoc-extra-addons-trunk

Proposed by Mariano Ruiz
Status: Merged
Merged at revision: 167
Proposed branch: lp:~eoc/openobject-addons/eoc-extra-addons-fix-bug1240243-product_variant
Merge into: lp:~eoc/openobject-addons/eoc-extra-addons-trunk
Diff against target: 54 lines (+9/-9)
2 files modified
product_variant_multi/__openerp__.py (+1/-1)
product_variant_multi/product_variant.py (+8/-8)
To merge this branch: bzr merge lp:~eoc/openobject-addons/eoc-extra-addons-fix-bug1240243-product_variant
Reviewer Review Type Date Requested Status
Martin Collins (community) test Approve
Review via email: mp+209830@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Martin Collins (mkc-steadfast) wrote :

It's good, thanks.

review: Approve (test)
Revision history for this message
Mariano Ruiz (marianoruiz) wrote :

Thanks to you for provide the patch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product_variant_multi/__openerp__.py'
2--- product_variant_multi/__openerp__.py 2014-02-25 23:04:56 +0000
3+++ product_variant_multi/__openerp__.py 2014-03-07 03:36:37 +0000
4@@ -21,7 +21,7 @@
5 ##############################################################################
6 {
7 "name" : "Products with multi-level variants",
8- "version" : "1.0.1",
9+ "version" : "1.0.2",
10 "author" : "Tiny, Akretion, fixed by Enterprise Objects Consulting",
11 "website" : "http://www.eoconsulting.com.ar",
12 "category" : "Generic Modules/Inventory Control",
13
14=== modified file 'product_variant_multi/product_variant.py'
15--- product_variant_multi/product_variant.py 2014-02-27 04:13:47 +0000
16+++ product_variant_multi/product_variant.py 2014-03-07 03:36:37 +0000
17@@ -65,7 +65,7 @@
18 if context.get('product_tmpl_id', False):
19 return super(product_variant_dimension_type, self).name_search(cr, uid, '', args, 'ilike', None, None)
20 else:
21- return super(product_variant_dimension_type, self).name_search(cr, uid, '', None, 'ilike', None, None)
22+ return super(product_variant_dimension_type, self).name_search(cr, uid, name, None, 'ilike', None, None)
23
24 product_variant_dimension_type()
25
26@@ -281,10 +281,10 @@
27 res = {}
28 temp_val_list = []
29 for value in product_temp.value_ids:
30- if res.get(value.dimension_id, False):
31- res[value.dimension_id] += [value.id]
32+ if res.get(value.option_id.dimension_id, False):
33+ res[value.option_id.dimension_id] += [value.id]
34 else:
35- res[value.dimension_id] = [value.id]
36+ res[value.option_id.dimension_id] = [value.id]
37 for dim in res:
38 temp_val_list += [res[dim] + (not dim.mandatory_dimension and [None] or [])]
39
40@@ -481,11 +481,11 @@
41 inherit this function to hack the code generation'''
42 product = self.browse(cr, uid, product_id, context=context)
43 model = product.variant_model_name
44- r = map(lambda dim: [dim.dimension_id.sequence,
45- self.parse(cr, uid, dim, model, context=context)],
46- product.dimension_value_ids)
47+ r = map(lambda dim: [dim.option_id.dimension_id.sequence,
48+ dim.dimension_id.sequence, self.parse(cr, uid, dim, model, context=context)],
49+ product.dimension_value_ids)
50 r.sort()
51- r = [x[1] for x in r]
52+ r = [x[2] for x in r]
53 new_variant_name = (product.variant_model_name_separator or '').join(r)
54 return new_variant_name
55

Subscribers

People subscribed via source and target branches