diff --git a/tailbone/views/purchasing/receiving.py b/tailbone/views/purchasing/receiving.py index b6e24dd8..7d21abb2 100644 --- a/tailbone/views/purchasing/receiving.py +++ b/tailbone/views/purchasing/receiving.py @@ -742,6 +742,7 @@ class ReceivingBatchView(PurchasingBatchView): row.product = other_row.product self.handler.add_row(batch, row) self.Session.flush() + self.handler.refresh_batch_status(batch) return row # try to locate product by uuid before other, more specific key @@ -751,6 +752,7 @@ class ReceivingBatchView(PurchasingBatchView): row.product = product self.handler.add_row(batch, row) self.Session.flush() + self.handler.refresh_batch_status(batch) return row key = self.rattail_config.product_key() @@ -767,6 +769,7 @@ class ReceivingBatchView(PurchasingBatchView): row.product = product self.handler.add_row(batch, row) self.Session.flush() + self.handler.refresh_batch_status(batch) return row # check for "bad" upc @@ -775,11 +778,16 @@ class ReceivingBatchView(PurchasingBatchView): # product not in system, but presumably sane upc, so add to batch anyway row = model.PurchaseBatchRow() - row.upc = provided # TODO: why not checked? how to know? + add_check_digit = True # TODO: make this dynamic, of course + if add_check_digit: + row.upc = checked + else: + row.upc = provided row.item_id = entry row.description = "(unknown product)" self.handler.add_row(batch, row) self.Session.flush() + self.handler.refresh_batch_status(batch) return row elif key == 'item_id': @@ -791,6 +799,7 @@ class ReceivingBatchView(PurchasingBatchView): row.product = product self.handler.add_row(batch, row) self.Session.flush() + self.handler.refresh_batch_status(batch) return row # check for "too long" item_id @@ -803,6 +812,7 @@ class ReceivingBatchView(PurchasingBatchView): row.description = "(unknown product)" self.handler.add_row(batch, row) self.Session.flush() + self.handler.refresh_batch_status(batch) return row else: