better backword compatibility: ignore product options if not present

This commit is contained in:
Helmut Merz 2015-06-20 09:29:42 +02:00
parent 620bf6fe25
commit 81d17e8966

View file

@ -116,8 +116,9 @@ class OrderItems(object):
def add(self, product, party, shop, order='???', run=0, **kw):
kw['shop'] = self.getUid(shop)
options = kw.get('options', [])
existing = self.getCart(party, order, shop, run, product=product)
options = kw.get('options')
if options is not None:
existing = [item for item in existing
if (item.data.get('options') or []) == options]
if existing: