From 9e13e2a146deb3d6f7ca7c2a7921be871c4a439a Mon Sep 17 00:00:00 2001 From: Johan De Taeye Date: Thu, 12 Sep 2024 12:25:50 +0200 Subject: [PATCH] sales order mapping: improved checks on warehouse, customer and product --- frepple/controllers/outbound.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/frepple/controllers/outbound.py b/frepple/controllers/outbound.py index 514edd0..3acc490 100644 --- a/frepple/controllers/outbound.py +++ b/frepple/controllers/outbound.py @@ -1981,10 +1981,22 @@ def getReservedQuantity(stock_move_id): for i in so_line: name = "%s %d" % (i["order_id"][1], i["id"]) batch = i["order_id"][1] - product = self.product_product.get(i["product_id"][0], None) + product = ( + self.product_product.get(i["product_id"][0], None) + if i["product_id"] + else None + ) j = so[i["order_id"][0]] - location = j["warehouse_id"][1] - customer = self.map_customers.get(j["partner_id"][0], None) + location = ( + self.warehouses.get(j["warehouse_id"][0], None) + if j["warehouse_id"] + else None + ) + customer = ( + self.map_customers.get(j["partner_id"][0], None) + if j["partner_id"] + else None + ) if not customer or not location or not product: # Not interested in this sales order...