Merge lp:~richard-willowit/magentoerpconnect/magentoerpconnect into lp:magentoerpconnect/oerp6.1-stable

Proposed by Richard deMeester
Status: Rejected
Rejected by: Guewen Baconnier @ Camptocamp
Proposed branch: lp:~richard-willowit/magentoerpconnect/magentoerpconnect
Merge into: lp:magentoerpconnect/oerp6.1-stable
Diff against target: 22 lines (+6/-3)
1 file modified
magentoerpconnect/settings/1.5.0.0/product/external.mappinglines.template.csv (+6/-3)
To merge this branch: bzr merge lp:~richard-willowit/magentoerpconnect/magentoerpconnect
Reviewer Review Type Date Requested Status
Sébastien BEAU - http://www.akretion.com Pending
MagentoERPConnect core editors Pending
Review via email: mp+118315@code.launchpad.net

Description of the change

Was exporting all of a prdoucts categories, even if they are not exportable.

This is in conjunction with a change to e-commerce-addons.

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

Link to the proposal in e-commerce-addons: https://code.launchpad.net/~richard-willowit/e-commerce-addons/ok-for-shop/+merge/118447

I wrote some remarks on this latter.

Revision history for this message
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote :

Hello Richard,
First of all thanks for helping us on this project. It's really cool to have some contribution from other team.
Regarding your fix, something ago Alexis introduce an abstract fonction in base_sale_multichannels that list each product category taking care of the shop and retrieve the external_id if the category have been not yet exported it export it automatically.

The function is called "_get_or_create_ext_category_ids_for_shop" and it is on the class product_product.
So I just propose to re-use the same code.
You can test my fix here: https://code.launchpad.net/~sebastien.beau/magentoerpconnect/magentoerpconnect-bug-1033378/+merge/141881
Also you need to use this branch for e-commerce-addons because during a previous merge I made some mistake:
https://code.launchpad.net/~sebastien.beau/e-commerce-addons/e-commerce-addons-bug-1033378/+merge/141882

Can you test my patch? If you approve it I will merge it in main branch

Thanks for your feedback, and happy new year

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

An alternative patch has been merged. I put the state 'rejected' not to criticize the quality of your patch but the fact that the proposal is not to merge.

Unmerged revisions

670. By Richard deMeester

Check product categories are exportable before including.

If a product is in multiple categories, but not all are exportable
for a given shop, then only export those catories which are.

This is in conjunction with a change in e-commerce-addons.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'magentoerpconnect/settings/1.5.0.0/product/external.mappinglines.template.csv'
2--- magentoerpconnect/settings/1.5.0.0/product/external.mappinglines.template.csv 2012-06-21 16:17:58 +0000
3+++ magentoerpconnect/settings/1.5.0.0/product/external.mappinglines.template.csv 2012-08-06 08:11:20 +0000
4@@ -56,12 +56,15 @@
5 categ_ids = [resource['categ_id'][0]] + resource.get('categ_ids', [])
6 mag_categ_ids = []
7 for categ_id in categ_ids:
8- mag_categ_id = cat_obj.get_or_create_extid(cr, uid, external_session, categ_id, context=context)
9- mag_categ_ids.append(mag_categ_id)
10+ if context is None:
11+ context = {}
12+ if not context.get('sale_shop_id') or cat_obj.ok_for_shop(cr,uid,categ_id,context['sale_shop_id'],context=context):
13+ mag_categ_id = cat_obj.get_or_create_extid(cr, uid, external_session, categ_id, context=context)
14+ mag_categ_ids.append(mag_categ_id)
15 result=[('categories', mag_categ_ids)]",,
16 "mag1500_product_product_special_price",,"in_out","function","special_price",,"float","False","magentoerpconnect.mag1500_product_product","special_price","if 'x_magerp_special_price' in resource: result = [('x_magerp_special_price', ifield)]","if 'x_magerp_special_price' in resource:
17 if resource['x_magerp_special_price']:
18 result = [('special_price', resource['x_magerp_special_price'])]
19 else:
20 result = [('special_price', False)]",,
21-mag1500_product_product_product_link,,out,sub-mapping,product_link,product_links.field_product_product_product_link_ids,list,False,magentoerpconnect.mag1500_product_product,,,,magentoerpconnect.mag1500_product_link,
22+"mag1500_product_product_product_link",,"out","sub-mapping","product_link","product_links.field_product_product_product_link_ids","list","False","magentoerpconnect.mag1500_product_product",,,,"magentoerpconnect.mag1500_product_link",