savoirfairelinux-openerp team mailing list archive
-
savoirfairelinux-openerp team
-
Mailing list archive
-
Message #00095
[Merge] lp:~akretion-team/e-commerce-addons/fix-export-product-6.1 into lp:e-commerce-addons/oerp6.1-stable
Benoit Guillot - http://www.akretion.com has proposed merging lp:~akretion-team/e-commerce-addons/fix-export-product-6.1 into lp:e-commerce-addons/oerp6.1-stable.
Requested reviews:
extra-addons-commiter (extra-addons-commiter)
For more details, see:
https://code.launchpad.net/~akretion-team/e-commerce-addons/fix-export-product-6.1/+merge/163695
This merge proposal fix the context in the wizard to export the products.
Indeed, in the actual state, the context is modified during the export of the first product.
In some cases it can causes problems.
For instance if you export the product links additionnaly to the product, for the next product only the product links will be exported because of the changes in the context.
To avoid this, we use the same original context for each products to export.
--
https://code.launchpad.net/~akretion-team/e-commerce-addons/fix-export-product-6.1/+merge/163695
Your team extra-addons-commiter is requested to review the proposed merge of lp:~akretion-team/e-commerce-addons/fix-export-product-6.1 into lp:e-commerce-addons/oerp6.1-stable.
=== modified file 'base_sale_export_product/wizard/export_product.py'
--- base_sale_export_product/wizard/export_product.py 2012-12-07 12:44:57 +0000
+++ base_sale_export_product/wizard/export_product.py 2013-05-14 12:16:29 +0000
@@ -55,9 +55,9 @@
for shop in sale_shop_obj.browse(cr, uid, shop_ids, context=context):
if not shop.referential_id:
raise except_osv(_("User Error"),
- _("The shop '%s' doesn't have any external "
- "referential are you sure that it's an external sale shop? "
- "If yes syncronize it before exporting product")%(shop.name,))
+ _("The shop '%s' doesn't have any external "
+ "referential are you sure that it's an external sale shop? "
+ "If yes syncronize it before exporting product")%(shop.name,))
external_session = ExternalSession(shop.referential_id, shop)
context = sale_shop_obj.init_context_before_exporting_resource(cr, uid, external_session, shop.id, 'product.product', context=context)
none_exportable_product = set(product_ids) - set([product.id for product in shop.exportable_product_ids])
@@ -70,7 +70,8 @@
" - if the website option is correctly configured. \n"
" - if the check box to export the product to the shop is checked")%(products, shop.name))
for product_id in product_ids:
- self._export_one_product(cr, uid, external_session, product_id, options, context=context)
+ ctx = context.copy()
+ self._export_one_product(cr, uid, external_session, product_id, options, context=ctx)
return {'type': 'ir.actions.act_window_close'}
def export_product(self, cr, uid, id, context=None):
Follow ups