From 38734c4a6b3883768173b9aa614ae3a8f6f47c9d Mon Sep 17 00:00:00 2001 From: Hicham Lahlou Date: Tue, 9 Jul 2024 16:22:31 +0200 Subject: [PATCH] fix PO quantity and sales order status --- frepple/controllers/outbound.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/frepple/controllers/outbound.py b/frepple/controllers/outbound.py index d4e101f..55a45c6 100644 --- a/frepple/controllers/outbound.py +++ b/frepple/controllers/outbound.py @@ -1967,10 +1967,6 @@ def getReservedQuantity(stock_move_id): yield "\n" yield "\n" - stock_moves_dict_confirmed = [ - i for i in stock_moves_dict if stock_moves_dict[i]["state"] == "confirmed" - ] - for i in so_line: name = "%s %d" % (i["order_id"][1], i["id"]) batch = i["order_id"][1] @@ -1992,7 +1988,8 @@ def getReservedQuantity(stock_move_id): # if no stock_move if that SO line is still open, we can consider the line closed state = j.get("state", "sale") if state == "sale" and not any( - x in stock_moves_dict_confirmed for x in i["move_ids"] + x in stock_moves_dict and stock_moves_dict[x] not in ("cancel", "done") + for x in i["move_ids"] ): state = "done" if state in ("draft", "sent"): @@ -2243,7 +2240,7 @@ def export_purchaseorders(self): end = datetime.fromisoformat(end) start = self.formatDateTime(start if start < end else end) end = self.formatDateTime(end) - qty = mv.product_qty - mv.quantity + qty = mv.product_qty supplier = self.map_customers.get(j.partner_id.id) if not supplier: # supplier is archived :-(