ensure context is defined

This commit is contained in:
?ngel ?lvarez 2019-06-06 21:43:37 +02:00
parent 6bff02ec16
commit f24d859d0a

View file

@ -59,6 +59,8 @@ class Product(StockMixin, metaclass=PoolMeta):
@classmethod
def _quantity_context(cls, name):
context = super(Product, cls)._quantity_context(name)
if not context:
context = {}
if name.endswith('number_of_packages'):
context['number_of_packages'] = True
return context