~jan-philipp-fischer/openerp-connector-magento/7.0-strip-html

« back to all changes in this revision

Viewing changes to magentoerpconnect/product.py

  • Committer: Guewen Baconnier
  • Date: 2013-12-18 19:31:21 UTC
  • mto: This revision was merged to the branch mainline in revision 940.
  • Revision ID: guewen.baconnier@camptocamp.com-20131218193121-11jcbziunyv31cyc
[FIX] the main image has the 'image' type, not 'base'

Show diffs side-by-side

added added

removed removed

Lines of Context:
259
259
 
260
260
    def _sort_images(self, images):
261
261
        """ Returns a list of images sorted by their priority.
262
 
        An image with the 'base' type is the the primary one.
 
262
        An image with the 'image' type is the the primary one.
263
263
        The other images are sorted by their position.
264
264
 
265
265
        The returned list is reversed, the items at the end
267
267
        """
268
268
        if not images:
269
269
            return {}
270
 
        # place the images where the type is 'base' first then
 
270
        # place the images where the type is 'image' first then
271
271
        # sort them by the reverse priority (last item of the list has
272
272
        # the the higher priority)
273
273
        def priority(image):
274
 
            primary = 'base' in image['types']
 
274
            primary = 'image' in image['types']
275
275
            try:
276
276
                position = int(image['position'])
277
277
            except ValueError: