From ca716436941dac3197c4cd823ead0e698aa7db32 Mon Sep 17 00:00:00 2001 From: Pratima Gupta Date: Thu, 31 Aug 2017 11:31:00 +0530 Subject: [PATCH] [IMP] mrp_repair: make stock.moves generated by a repair refer to repair Instead of the mrp.repair.line. --- addons/mrp_repair/data/ir_sequence_data.xml | 2 +- addons/mrp_repair/models/mrp_repair.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/mrp_repair/data/ir_sequence_data.xml b/addons/mrp_repair/data/ir_sequence_data.xml index 3a47f77e404..095afd57002 100644 --- a/addons/mrp_repair/data/ir_sequence_data.xml +++ b/addons/mrp_repair/data/ir_sequence_data.xml @@ -4,7 +4,7 @@ Repair Order mrp.repair - RMA + RMA/ 5 diff --git a/addons/mrp_repair/models/mrp_repair.py b/addons/mrp_repair/models/mrp_repair.py index e61f72abccf..5ef28ce88f2 100644 --- a/addons/mrp_repair/models/mrp_repair.py +++ b/addons/mrp_repair/models/mrp_repair.py @@ -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