Combine size and UOM for "size" column in export

This commit is contained in:
Lance Edgar 2020-04-14 16:00:31 -05:00
parent 6905b387d0
commit 190ba506e5

View file

@ -407,11 +407,13 @@ class InventoryItemImporter(FromCore, catapult_importing.model.InventoryItemImpo
if self.exclude_missing_department: if self.exclude_missing_department:
return 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 # 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 # find some of these chars in a client DB and needed to avoid them, b/c
# the openpyxl lib said IllegalCharacterError # 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 = log.warning if self.warn_size_null_byte else log.debug
logger("product %s has null byte in size field: %s", logger("product %s has null byte in size field: %s",
product.upc, product) product.upc, product)