Merge lp:~sebastien.beau/magentoerpconnect/oerp6.1-stable-fix-image-export into lp:magentoerpconnect/oerp6.1-stable

Proposed by Sébastien BEAU - http://www.akretion.com
Status: Needs review
Proposed branch: lp:~sebastien.beau/magentoerpconnect/oerp6.1-stable-fix-image-export
Merge into: lp:magentoerpconnect/oerp6.1-stable
Diff against target: 11 lines (+1/-0)
1 file modified
magentoerpconnect/product.py (+1/-0)
To merge this branch: bzr merge lp:~sebastien.beau/magentoerpconnect/oerp6.1-stable-fix-image-export
Reviewer Review Type Date Requested Status
MagentoERPConnect core editors Pending
Review via email: mp+168296@code.launchpad.net

Description of the change

Fix image export. Add filter on exportable image

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

You don't need to convert the argument of set.intersection() to a set, it accepts any iterable.

    images_to_update_ids = list(set(images_exportable_ids).intersection(images_to_update_ids))

Unmerged revisions

694. By Sébastien BEAU - http://www.akretion.com

[FIX] fix image export, only exportable image should be exported

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'magentoerpconnect/product.py'
2--- magentoerpconnect/product.py 2013-06-06 18:09:24 +0000
3+++ magentoerpconnect/product.py 2013-06-09 17:27:26 +0000
4@@ -1557,6 +1557,7 @@
5 image_obj = self.pool.get('product.images')
6 images_exportable_ids = image_obj.search(cr, uid, [('product_id', 'in', ids)], context=context)
7 images_to_update_ids = image_obj.get_all_oeid_from_referential(cr, uid, external_session.referential_id.id, context=None)
8+ images_to_update_ids = list(set(images_exportable_ids).intersection(set(images_to_update_ids)))
9 images_to_create = [x for x in images_exportable_ids if not x in images_to_update_ids]
10 if shop.last_images_export_date:
11 images_to_update_ids = image_obj.search(cr, uid, [('id', 'in', images_to_update_ids), '|', ('create_date', '>', shop.last_images_export_date), ('write_date', '>', shop.last_images_export_date)], context=context)