Fall back to empty string for some product fields, in Rattail -> CORE

This commit is contained in:
Lance Edgar 2020-03-15 16:03:24 -05:00
parent cd93d3e36b
commit c44dba6456

View file

@ -204,8 +204,8 @@ class ProductImporter(FromRattail, corepos_importing.model.ProductImporter):
return { return {
'upc': product.item_id, 'upc': product.item_id,
'brand': product.brand.name if product.brand else '', 'brand': product.brand.name if product.brand else '',
'description': product.description or None, 'description': product.description or '',
'size': product.size, 'size': product.size or '',
'department': str(product.department.number) if product.department else None, 'department': str(product.department.number) if product.department else None,
'normal_price': '{:0.2f}'.format(product.regular_price.price) if product.regular_price else None, 'normal_price': '{:0.2f}'.format(product.regular_price.price) if product.regular_price else None,
'foodstamp': '1' if product.food_stampable else '0', 'foodstamp': '1' if product.food_stampable else '0',