Product picture taken from Magento is not the expected one

Bug #1258418 reported by Stefaan Ferket on 2013-12-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP Connector - Magento
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


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):
        """ Check if the images are sorted in the correct priority """
        env = mock.Mock()
        importer = CatalogImageImporter(env)
        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]
                          [file4, file3, file2, file1])

affects: openerp-connector → openerp-connector-magento
Stefaan Ferket (s-ferket) wrote :


We just tested wit this revision:
revno: 935
branch-nick: openerp-connector-magento

We still see the same problem.


Can you call the XML/RPC API and give me the result of the method "product_media.list" on a product with this problem please?

Stefaan Ferket (s-ferket) wrote :

{'url': '',
'label': 'Afmetingen picture',
'file': '/a/f/afmetingen_picture.jpg',
'position': '2'
, 'exclude': '0'
, 'types': []}

, {'url': ''
, 'label': 'Verschil picture'
, 'file': '/0/1/verschil_picture.jpg'
, 'position': '3'
, 'exclude': '0'
, 'types': ['image']}

, {'url': ''
, 'label': 'Standard_picture'
, 'file': '/0/1/standard_picture.jpg'
, 'position': '4'
, 'exclude': '1'
, 'types': []}]

It seems that 'types': ['image'] is the image we are after. This one has the checkbox "Base Image" set.

I should have mentioned we use Magento

Oh nice, thanks for the data. Looks like we are expecting 'base' while it should be 'image'.
According to the doc [0], that's still "image".


Changed in openerp-connector-magento:
importance: Undecided → Low
status: New → Confirmed

I proposed a patch here:

Would you test and give me your result on the merge proposal?


Changed in openerp-connector-magento:
assignee: nobody → Guewen Baconnier @ Camptocamp (gbaconnier-c2c)
Changed in openerp-connector-magento:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers