Skip to content

Commit

Permalink
Merge pull request #481 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 Oct 9, 2024
2 parents 441356c + 320efea commit 2e7a19b
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions frepple/controllers/inbound.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,36 @@ def run(self):

# Create purchase order
if supplier_id not in supplier_reference:
po = proc_order.create(
{
"company_id": self.company.id,
"partner_id": supplier_id,
# TODO Odoo has no place to store the location and criticality
# int(elem.get('location_id')),
# elem.get('criticality'),
"origin": "frePPLe",
}
)
po_args = {
"company_id": self.company.id,
"partner_id": supplier_id,
"origin": "frePPLe",
}
try:
picking_type_id = stck_picking_type.search(
[
("code", "=", "incoming"),
(
"warehouse_id",
"=",
int(elem.get("location_id")),
),
],
limit=1,
)[:1]
if not picking_type_id:
picking_type_id = stck_picking_type.search(
[
("code", "=", "incoming"),
("warehouse_id", "=", False),
],
limit=1,
)[:1]
if picking_type_id:
po_args["picking_type_id"] = picking_type_id.id
except Exception:
pass
po = proc_order.create(po_args)
po.payment_term_id = (
po.partner_id.property_supplier_payment_term_id.id
)
Expand Down

0 comments on commit 2e7a19b

Please sign in to comment.