[IMP] mrp_repair: make stock.moves generated by a repair refer to repair

Instead of the mrp.repair.line.
This commit is contained in:
Pratima Gupta
2017-08-31 21:22:48 -07:00
committed by Joren Van Onder
parent 096f8c56b7
commit ca71643694
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<record id="seq_mrp_repair" model="ir.sequence">
<field name="name">Repair Order</field>
<field name="code">mrp.repair</field>
<field name="prefix">RMA</field>
<field name="prefix">RMA/</field>
<field name="padding">5</field>
</record>
</data>
+3 -1
View File
@@ -418,7 +418,7 @@ class Repair(models.Model):
moves = self.env['stock.move']
for operation in repair.operations:
move = Move.create({
'name': operation.name,
'name': repair.name,
'product_id': operation.product_id.id,
'product_uom_qty': operation.product_uom_qty,
'product_uom': operation.product_uom.id,
@@ -435,6 +435,7 @@ class Repair(models.Model):
'location_id': operation.location_id.id, #TODO: owner stuff
'location_dest_id': operation.location_dest_id.id,})],
'repair_id': repair.id,
'origin': repair.name,
})
moves |= move
operation.write({'move_id': move.id, 'state': 'done'})
@@ -456,6 +457,7 @@ class Repair(models.Model):
'location_id': repair.location_id.id, #TODO: owner stuff
'location_dest_id': repair.location_dest_id.id,})],
'repair_id': repair.id,
'origin': repair.name,
})
consumed_lines = moves.mapped('move_line_ids')
produced_lines = move.move_line_ids