[FIX] stock_request_mrp: Avoid copying the relationship to mrp.production when duplicating a record

TT41342
This commit is contained in:
Víctor Martínez
2023-01-24 17:22:19 +01:00
parent 1b3ac48d1f
commit 5a8c7f92e6
2 changed files with 3 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ class StockRequest(models.Model):
"mrp_production_id", "mrp_production_id",
string="Manufacturing Orders", string="Manufacturing Orders",
readonly=True, readonly=True,
copy=False,
) )
production_count = fields.Integer( production_count = fields.Integer(
string="Manufacturing Orders count", string="Manufacturing Orders count",

View File

@@ -86,6 +86,8 @@ class TestStockRequestMrp(TestStockRequest):
manufacturing_order.button_mark_done() manufacturing_order.button_mark_done()
self.assertEqual(order.stock_request_ids.qty_in_progress, 0.0) self.assertEqual(order.stock_request_ids.qty_in_progress, 0.0)
self.assertEqual(order.stock_request_ids.qty_done, 5.0) self.assertEqual(order.stock_request_ids.qty_done, 5.0)
order2 = order.copy()
self.assertFalse(order2.production_ids)
def test_stock_request_order_action_cancel(self): def test_stock_request_order_action_cancel(self):
order = self._create_stock_request(self.stock_request_user, [(self.product, 5)]) order = self._create_stock_request(self.stock_request_user, [(self.product, 5)])