Let inventory batch handler decide what to do about unknown product scan
This commit is contained in:
parent
2532fcbea2
commit
12b567d3d2
|
@ -436,9 +436,6 @@ class InventoryBatchView(BatchMasterView):
|
||||||
if self.viewing and not batch.executed and not batch.complete:
|
if self.viewing and not batch.executed and not batch.complete:
|
||||||
f.remove_field('rowcount')
|
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
|
# 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
|
# probably be changed to require POST; for now we just require the "create
|
||||||
# batch row" perm and call it good..
|
# batch row" perm and call it good..
|
||||||
|
@ -508,7 +505,7 @@ class InventoryBatchView(BatchMasterView):
|
||||||
self.handler.add_row(batch, row)
|
self.handler.add_row(batch, row)
|
||||||
return row
|
return row
|
||||||
|
|
||||||
elif self.unknown_product_creates_row:
|
elif self.handler.unknown_product_creates_row:
|
||||||
row = model.InventoryBatchRow()
|
row = model.InventoryBatchRow()
|
||||||
row.upc = GPC(upc, calc_check_digit=False) # TODO: why not calc check digit?
|
row.upc = GPC(upc, calc_check_digit=False) # TODO: why not calc check digit?
|
||||||
row.description = "(unknown product)"
|
row.description = "(unknown product)"
|
||||||
|
|
Loading…
Reference in a new issue