Ignore:
Timestamp:
30 Dec 2014, 09:05:47 (10 years ago)
Author:
Henrik Bettermann
Message:

Check and add stored options first before adding recent product options.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py

    r12329 r12340  
    187187
    188188    def getValues(self, context):
    189         product = getattr(context, 'product_object', None)
    190         if product is None:
    191             return []
    192         return product.options
     189        options = []
     190        recent_options = getattr(
     191            getattr(context, 'product_object', None), 'options', [])
     192        # Check and add stored options first before adding recent
     193        # product options.
     194        if context.product_options:
     195            for stored_option in context.product_options:
     196                if stored_option not in recent_options:
     197                    options.append(stored_option)
     198        options += recent_options
     199        return options
    193200
    194201    def getToken(self, context, value):
Note: See TracChangeset for help on using the changeset viewer.