Give custorder batch handler a couple ways to affect adding new items

This commit is contained in:
Lance Edgar 2021-10-14 17:49:12 -04:00
parent 1b33c8a2b7
commit 53fc1508f3

View file

@ -530,10 +530,19 @@ class CustomerOrderView(MasterView):
return {'error': "Must specify a product UPC"} return {'error': "Must specify a product UPC"}
product = self.handler.locate_product_for_entry( 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: if not product:
return {'error': "Product not found"} 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) return self.info_for_product(batch, data, product)
def get_product_info(self, batch, data): def get_product_info(self, batch, data):