Skip to content

Commit

Permalink
Merge pull request #443 from frePPLe/16.0
Browse files Browse the repository at this point in the history
Syncing from upstream frePPLe/odoo (16.0)
  • Loading branch information
bt-admin authored May 25, 2024
2 parents d0ec36f + 7d0d325 commit a038d94
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions frepple/controllers/outbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -2067,6 +2067,9 @@ def export_purchaseorders(self):
# ("bid", "confirmed", "cancel"),
),
("order_id.state", "=", False),
"|",
("order_id.receipt_status", "!=", "full"),
("order_id.receipt_status", "=", False),
],
object=True,
)
Expand Down Expand Up @@ -2118,9 +2121,6 @@ def export_purchaseorders(self):
else:
batch = None

# if PO status is done, we should ignore this receipt
if j.state == "done":
continue
location = self.map_locations.get(mv.location_dest_id.id, None)
if not location:
continue
Expand All @@ -2145,13 +2145,12 @@ def export_purchaseorders(self):
quoteattr(self.map_customers.get(j.partner_id.id)),
)
else:
# METHOD 2: Create purchasing operations from stock moves
# METHOD 2: Create purchasing operations from purchase order lines
if not i["product_id"] or i["state"] == "cancel":
continue
item = self.product_product.get(i.product_id.id, None)
j = i.order_id
# if PO status is done, we should ignore this PO line
if j.state == "done" or not item:
if not item:
continue
location = self.mfg_location
if location and item and i.product_qty > i.qty_received:
Expand All @@ -2165,7 +2164,7 @@ def export_purchaseorders(self):
end = self.formatDateTime(end)
qty = self.convert_qty_uom(
i.product_qty - i.qty_received,
i.product_uom,
i.product_uom.id,
self.product_product[i.product_id.id]["template"],
)

Expand Down

0 comments on commit a038d94

Please sign in to comment.