Let inventory batch handler decide what to do about unknown product scan

This commit is contained in:
Lance Edgar 2020-03-29 13:09:14 -05:00
parent 2532fcbea2
commit 12b567d3d2

View file

@ -436,9 +436,6 @@ class InventoryBatchView(BatchMasterView):
if self.viewing and not batch.executed and not batch.complete:
f.remove_field('rowcount')
# TODO: document this, maybe move it etc.
unknown_product_creates_row = True
# TODO: this view can create new rows, with only a GET query. that should
# probably be changed to require POST; for now we just require the "create
# batch row" perm and call it good..
@ -508,7 +505,7 @@ class InventoryBatchView(BatchMasterView):
self.handler.add_row(batch, row)
return row
elif self.unknown_product_creates_row:
elif self.handler.unknown_product_creates_row:
row = model.InventoryBatchRow()
row.upc = GPC(upc, calc_check_digit=False) # TODO: why not calc check digit?
row.description = "(unknown product)"