From 59abc4995ea8bfeffa8e3810461e9b490513942f Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 21 Jan 2021 18:16:56 -0600 Subject: [PATCH] Fix 'size' and push 'unitofmeasure' when exporting to CORE Products --- rattail_corepos/corepos/importing/rattail.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rattail_corepos/corepos/importing/rattail.py b/rattail_corepos/corepos/importing/rattail.py index 895a973..9a9833c 100644 --- a/rattail_corepos/corepos/importing/rattail.py +++ b/rattail_corepos/corepos/importing/rattail.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2020 Lance Edgar +# Copyright © 2010-2021 Lance Edgar # # This file is part of Rattail. # @@ -31,7 +31,7 @@ from sqlalchemy import orm from rattail import importing from rattail.db import model from rattail.db.util import short_session -from rattail.util import OrderedDict +from rattail.util import OrderedDict, pretty_quantity from rattail_corepos.corepos import importing as corepos_importing from rattail_corepos.corepos.util import get_max_existing_vendor_id @@ -280,6 +280,7 @@ class ProductImporter(FromRattail, corepos_importing.model.ProductImporter): 'brand', 'description', 'size', + 'unitofmeasure', 'department', 'normal_price', 'foodstamp', @@ -300,7 +301,8 @@ class ProductImporter(FromRattail, corepos_importing.model.ProductImporter): 'upc': upc, 'brand': product.brand.name if product.brand else '', 'description': product.description or '', - 'size': product.size or '', + 'size': pretty_quantity(product.unit_size), + 'unitofmeasure': product.uom_abbreviation, '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, 'foodstamp': '1' if product.food_stampable else '0',