Give custorder batch handler a couple ways to affect adding new items
This commit is contained in:
parent
1b33c8a2b7
commit
53fc1508f3
|
@ -530,10 +530,19 @@ class CustomerOrderView(MasterView):
|
|||
return {'error': "Must specify a product UPC"}
|
||||
|
||||
product = self.handler.locate_product_for_entry(
|
||||
self.Session(), upc, product_key='upc')
|
||||
self.Session(), upc, product_key='upc',
|
||||
# nb. let handler know "why" we're doing this, so that it
|
||||
# can "modify" the result accordingly, i.e. return the
|
||||
# appropriate item when a "different" scancode is entered
|
||||
# by the user (e.g. PLU, and/or units vs. packs)
|
||||
variation='new_custorder')
|
||||
if not product:
|
||||
return {'error': "Product not found"}
|
||||
|
||||
reason = self.handler.why_not_add_product(product, batch)
|
||||
if reason:
|
||||
return {'error': reason}
|
||||
|
||||
return self.info_for_product(batch, data, product)
|
||||
|
||||
def get_product_info(self, batch, data):
|
||||
|
|
Loading…
Reference in a new issue