From 190ba506e58414550cf471dc47187e839119eeb4 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 14 Apr 2020 16:00:31 -0500 Subject: [PATCH] Combine size and UOM for "size" column in export --- .../corepos/importing/db/exporters/catapult_inventory.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rattail_corepos/corepos/importing/db/exporters/catapult_inventory.py b/rattail_corepos/corepos/importing/db/exporters/catapult_inventory.py index 5d73f68..3d898ba 100644 --- a/rattail_corepos/corepos/importing/db/exporters/catapult_inventory.py +++ b/rattail_corepos/corepos/importing/db/exporters/catapult_inventory.py @@ -407,11 +407,13 @@ class InventoryItemImporter(FromCore, catapult_importing.model.InventoryItemImpo if self.exclude_missing_department: return - size = product.size + size = "{} {}".format((product.size or '').strip(), + (product.unit_of_measure or '').strip()) + size = size.strip() # TODO: this logic may actually be client-specific? i just happened to # find some of these chars in a client DB and needed to avoid them, b/c # the openpyxl lib said IllegalCharacterError - if size is not None and '\x00' in size: + if '\x00' in size: logger = log.warning if self.warn_size_null_byte else log.debug logger("product %s has null byte in size field: %s", product.upc, product)