Product picture taken from Magento is not the expected one
Bug #1258418 reported by
Stefaan Ferket
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenERP Connector - Magento |
Fix Released
|
Low
|
Guewen Baconnier @ Camptocamp |
Bug Description
In Magento product we can define multiple pictures per product.
For every picture we can define at least these settings:
- Sort Order
- Base Image
A product can have only 1 base image.
OpenERP seems to take the image with the lowest sort order number.
We would expect OpenERP to take the picture that is marked as "Base Image"
We use module magentoerpconnect
Related branches
lp:~camptocamp/openerp-connector-magento/7.0-image-1258418-gbr
- Yannick Vaucher @ Camptocamp: Approve (code review, no tests)
-
Diff: 39 lines (+4/-4)2 files modifiedmagentoerpconnect/product.py (+3/-3)
magentoerpconnect/tests/test_import_product_image.py (+1/-1)
Changed in openerp-connector-magento: | |
status: | Confirmed → Fix Released |
To post a comment you must log in.
Hello,
Which revision of the Magento connector do you use?
Normally, the image with the 'base' type should be used first.
It should take the 'base' image first, then sort them by position, as seen in the test case below (images are .pop()'ed from the list, so the order goes from right to left). When one of the image can't be read (404 for instance), the next image will be imported.
def test_image_ priority( self): orter(env)
self.assertEqu als(importer. _sort_images( images) ,
[file4, file3, file2, file1])
""" Check if the images are sorted in the correct priority """
env = mock.Mock()
importer = CatalogImageImp
file1 = {'file': 'file1', 'types': ['base'], 'position': '10'}
file2 = {'file': 'file2', 'types': ['thumbnail'], 'position': '3'}
file3 = {'file': 'file3', 'types': ['thumbnail'], 'position': '4'}
file4 = {'file': 'file4', 'types': [], 'position': '10'}
images = [file2, file1, file4, file3]