[IMP] mrp_subcontracting_inhibit: Adding tests to check the behaviour of subcontracting_inhibit

TT38580
This commit is contained in:
Víctor Martínez
2022-09-16 09:15:29 +02:00
parent 9a8c206af0
commit a76bb08a79

View File

@@ -24,8 +24,7 @@ class TestMrpSubcontractingInhibit(common.SavepointCase):
{ {
"name": cls.supplier.id, "name": cls.supplier.id,
"min_qty": 1, "min_qty": 1,
"price": 5, "price": 10,
"subcontracting_inhibit": True,
}, },
), ),
( (
@@ -34,7 +33,8 @@ class TestMrpSubcontractingInhibit(common.SavepointCase):
{ {
"name": cls.supplier.id, "name": cls.supplier.id,
"min_qty": 1, "min_qty": 1,
"price": 10, "price": 5,
"subcontracting_inhibit": True,
}, },
), ),
], ],
@@ -100,3 +100,13 @@ class TestMrpSubcontractingInhibit(common.SavepointCase):
self.assertEqual(order.order_line.price_unit, 5) self.assertEqual(order.order_line.price_unit, 5)
order.button_confirm() order.button_confirm()
self.assertEqual(self._get_mrp_production_total(), 0) self.assertEqual(self._get_mrp_production_total(), 0)
def test_change_purchase_order_line_subcontracting_inhibit(self):
order_form = Form(self.env["purchase.order"])
order_form.partner_id = self.supplier
with order_form.order_line.new() as line_form:
line_form.product_id = self.product
line_form.product_qty = 1
self.assertEqual(line_form.price_unit, 10)
line_form.subcontracting_inhibit = True
self.assertEqual(line_form.price_unit, 5)