[14.0][FIX] repair_stock_move: fix state in repair lines

This commit is contained in:
DavidJForgeFlow
2023-02-09 11:40:45 +01:00
parent 32d9ac1c5f
commit 835f4b3847
2 changed files with 11 additions and 0 deletions

View File

@@ -172,5 +172,6 @@ class RepairOrder(models.Model):
if self.stock_move_ids:
# With this module this should always be the case, so this is
# effectively overriding the method.
self.operations.write({"state": "done"})
return {self.id: self.move_id.id}
return super().action_repair_done()

View File

@@ -118,6 +118,11 @@ class TestRepairStockMove(common.SavepointCase):
"confirmed",
"Generated stock move state should be confirmed",
)
self.assertEqual(
operation.state,
"confirmed",
"Repair line state should be confirmed",
)
# Start Repair
self.repair1.action_repair_start()
# End Repair
@@ -133,6 +138,11 @@ class TestRepairStockMove(common.SavepointCase):
"done",
"Generated stock move state should be done",
)
self.assertEqual(
operation.state,
"done",
"Repair line state should be done",
)
def _create_simple_repair_order(self, invoice_method):
product_to_repair = self.product_1