From 93b752f436095ac0efb554fe2e49dd65b1312240 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 17 Oct 2021 18:07:57 -0400 Subject: [PATCH] Invoke handler when adding new item to custorder batch --- tailbone/views/custorders/orders.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tailbone/views/custorders/orders.py b/tailbone/views/custorders/orders.py index b7b583dc..0b72f377 100644 --- a/tailbone/views/custorders/orders.py +++ b/tailbone/views/custorders/orders.py @@ -682,14 +682,10 @@ class CustomerOrderView(MasterView): if not product: return {'error': "Product not found"} - row = self.handler.make_row() - row.item_entry = product.uuid - row.product = product - row.order_quantity = decimal.Decimal(data.get('order_quantity') or '0') - row.order_uom = data.get('order_uom') - self.handler.add_row(batch, row) + row = self.handler.add_product(batch, product, + decimal.Decimal(data.get('order_quantity') or '0'), + data.get('order_uom')) self.Session.flush() - self.Session.refresh(row) else: # product is not known raise NotImplementedError # TODO