Merge lp:~sebastien.beau/e-commerce-addons/e-commerce-addons-bug-1033378 into lp:~extra-addons-commiter/e-commerce-addons/oerp6.1-stable

Proposed by Sébastien BEAU - http://www.akretion.com
Status: Merged
Merged at revision: 280
Proposed branch: lp:~sebastien.beau/e-commerce-addons/e-commerce-addons-bug-1033378
Merge into: lp:~extra-addons-commiter/e-commerce-addons/oerp6.1-stable
Diff against target: 42 lines (+1/-18)
1 file modified
base_sale_multichannels/product.py (+1/-18)
To merge this branch: bzr merge lp:~sebastien.beau/e-commerce-addons/e-commerce-addons-bug-1033378
Reviewer Review Type Date Requested Status
Richard deMeester (community) Approve
Guewen Baconnier @ Camptocamp no test, review Approve
Sébastien BEAU - http://www.akretion.com Pending
Review via email: mp+141882@code.launchpad.net

Description of the change

Error during previous merge, this fix is need for prestashoperpconnect and also magentoerpconnect (as propose to use the same function in an other merge here => https://code.launchpad.net/~sebastien.beau/magentoerpconnect/magentoerpconnect-bug-1033378/+merge/141881)

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM
On lines 39-40, you removed 2 lines, but there should be 2 lines above the class according to the pep8.

review: Approve (no test, review)
Revision history for this message
Richard deMeester (richard-willowit) wrote :

I am not in a position to test this for quite some time (I am travelling).

Visually, it appears to achieve what I believe it should.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_sale_multichannels/product.py'
2--- base_sale_multichannels/product.py 2013-01-03 10:57:26 +0000
3+++ base_sale_multichannels/product.py 2013-01-04 10:22:55 +0000
4@@ -66,21 +66,6 @@
5 context=context)
6 return res
7
8-
9- def _get_categories_ids_for_shop(self, cr, uid, product_id, shop_id, context=None):
10- shop_categ_ids = self.pool.get('sale.shop').read(cr, uid, shop_id,
11- ['exportable_category_ids'],
12- context=context)['exportable_category_ids']
13- product = self.read(cr, uid, product_id, ['categ_ids', 'categ_id'], context=context)
14- product_categ_ids = product['categ_ids']
15- if product['categ_id'][0] not in product_categ_ids:
16- product_categ_ids.append(product['categ_id'][0])
17- res = []
18- for categ in product_categ_ids:
19- if categ in shop_categ_ids:
20- res.append(categ)
21- return res
22-
23 def _get_categories_ids_for_shop(self, cr, uid, product_id, shop_id, context=None):
24 shop_obj = self.pool.get('sale.shop')
25 shop_values = shop_obj.read(cr, uid, shop_id,
26@@ -90,7 +75,7 @@
27 product = self.read(cr, uid, product_id, ['categ_ids', 'categ_id'], context=context)
28 product_categ_ids = set(product['categ_ids'])
29 product_categ_ids.add(product['categ_id'][0])
30- return list(prod_categ_ids & shop_categ_ids)
31+ return list(product_categ_ids & shop_categ_ids)
32
33 def _get_or_create_ext_category_ids_for_shop(self, cr, uid, external_session, product_id, context=None):
34 res = []
35@@ -99,8 +84,6 @@
36 res.append(categ_obj.get_or_create_extid(cr, uid, external_session, oe_categ_id, context=context))
37 return res
38
39-
40-
41 class product_template(Model):
42 _inherit = 'product.template'
43