From eb23784e8d772f036636ed231ca37411357dd32e Mon Sep 17 00:00:00 2001 From: Hicham Lahlou Date: Fri, 17 Jan 2025 13:44:10 +0100 Subject: [PATCH] fix reordering point using calendar with warehouse name instead of warehouse code --- frepple/controllers/outbound.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/frepple/controllers/outbound.py b/frepple/controllers/outbound.py index 23f2edc..807924f 100644 --- a/frepple/controllers/outbound.py +++ b/frepple/controllers/outbound.py @@ -2825,13 +2825,20 @@ def export_orderpoints(self): ) if not item: continue + warehouse = ( + self.warehouses.get(i["warehouse_id"][0]) + if i["warehouse_id"] + else None + ) + if not warehouse: + continue uom_factor = self.convert_qty_uom( 1.0, i["product_uom"][0], self.product_product[i["product_id"][0]]["template"], ) yield '\n' % ( - quoteattr("%s @ %s" % (item["name"], i["warehouse_id"][1])), + quoteattr("%s @ %s" % (item["name"], warehouse)), ((i["product_min_qty"] or 0) * uom_factor), ((i["product_max_qty"] or 0) * uom_factor), quoteattr(item["name"]), @@ -2860,12 +2867,19 @@ def export_orderpoints(self): ) if not item: continue + warehouse = ( + self.warehouses.get(i["warehouse_id"][0]) + if i["warehouse_id"] + else None + ) + if not warehouse: + continue uom_factor = self.convert_qty_uom( 1.0, i["product_uom"][0], self.product_product[i["product_id"][0]]["template"], ) - name = "%s @ %s" % (item["name"], i["warehouse_id"][1]) + name = "%s @ %s" % (item["name"], warehouse) if i["product_min_qty"]: yield """