Skip to content

Commit

Permalink
[FIX] mrp_subcontracting_purchase: Purchase order tests is updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
geomer198 committed Oct 9, 2023
1 parent 8c0f619 commit 5c50253
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions mrp_subcontracting_purchase/tests/test_purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,23 @@ def test_po_to_subcontractor(self):
self.assertEqual(po.order_line.qty_received, 1.0)

def test_action_view_picking(self):
self.product_component = self.env["product.product"].create(
{
"name": "Component",
"type": "consu",
}
)
self.env["mrp.bom"].create(
{
"product_tmpl_id": self.finished.product_tmpl_id.id,
"product_qty": 1,
"type": "phantom",
"bom_line_ids": [
(0, 0, {"product_id": self.product_component.id, "product_qty": 1}),
],
}
)

po = Form(self.env["purchase.order"])
po.partner_id = self.subcontractor_partner1
with po.order_line.new() as po_line:
Expand All @@ -520,3 +537,6 @@ def test_action_view_picking(self):
self.assertEqual(po.partner_id.id, context.get("default_partner_id"))
self.assertEqual(po.picking_type_id.id, context.get("default_picking_type_id"))
self.assertListEqual(result.get("domain"), [("id", "in", [])])
po.button_confirm()
po.order_line._compute_qty_received()
self.assertFalse(po.order_line.qty_received)

0 comments on commit 5c50253

Please sign in to comment.