Skip to content

Commit

Permalink
Merge pull request #498 from frePPLe/17.0
Browse files Browse the repository at this point in the history
Syncing from upstream frePPLe/odoo (17.0)
  • Loading branch information
bt-admin authored Jan 8, 2025
2 parents 2410340 + 40803fc commit 57ebe8e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions frepple/controllers/inbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def run(self):
stck_picking_type = self.env["stock.picking.type"].with_user(
self.actual_user
)
bom_type = self.env["mrp.bom"].with_user(self.actual_user)
stck_picking = self.env["stock.picking"].with_user(self.actual_user)
stck_move = self.env["stock.move"].with_user(self.actual_user)
stck_warehouse = self.env["stock.warehouse"].with_user(self.actual_user)
Expand Down Expand Up @@ -706,6 +707,19 @@ def run(self):
remark = "frePPLe - %s" % remark
else:
remark = "frePPLe"
bom_id = int(elem.get("operation").rsplit(" ", 1)[1])
try:
bom = bom_type.search(
[
("id", "=", bom_id),
],
limit=1,
)
if not bom and bom.type == "phantom":
# Avoid creating MO on a) non-existing BOMs and b) phantom/kit BOMs
continue
except Exception:
pass
mo = mfg_order.with_context(context).create(
{
"product_qty": elem.get("quantity"),
Expand All @@ -715,9 +729,7 @@ def run(self):
"company_id": self.company.id,
"product_uom_id": int(uom_id),
"picking_type_id": picking.id,
"bom_id": int(
elem.get("operation").rsplit(" ", 1)[1]
),
"bom_id": bom_id,
"qty_producing": 0.00,
# TODO no place to store the criticality
# elem.get('criticality'),
Expand Down

0 comments on commit 57ebe8e

Please sign in to comment.