Skip to content

Commit

Permalink
fix PO quantity and sales order status
Browse files Browse the repository at this point in the history
  • Loading branch information
hichamlahlou committed Jul 9, 2024
1 parent 6337d93 commit 38734c4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions frepple/controllers/outbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -1967,10 +1967,6 @@ def getReservedQuantity(stock_move_id):
yield "<!-- sales order lines -->\n"
yield "<demands>\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]
Expand All @@ -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"):
Expand Down Expand Up @@ -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 :-(
Expand Down

0 comments on commit 38734c4

Please sign in to comment.