From bb5d7cf5725bb6642838fc70717cbdc8b540588c Mon Sep 17 00:00:00 2001 From: Chris Halls Date: Fri, 16 Apr 2010 16:24:29 +0100 Subject: [PATCH] [FIX] When duplicating a production order, clear existing stock moves If a production order is duplicated, it will be because someone wants to build the same item(s) again. The copy function already puts the production order back into state draft but does not delete the related stock movements and consumed products. bzr revid: chris.halls@credativ.co.uk-20100416152429-2ygxfb32lvew3bgl --- addons/mrp/mrp.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index eda4f076602..0e051e7ac2e 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -560,8 +560,12 @@ class mrp_production(osv.osv): default.update({ 'name': self.pool.get('ir.sequence').get(cr, uid, 'mrp.production'), 'move_lines' : [], - 'move_created_ids': [], - 'state': 'draft' + 'move_lines2' : [], + 'move_created_ids' : [], + 'move_created_ids2' : [], + 'product_lines' : [], + 'state': 'draft', + 'picking_id': False }) return super(mrp_production, self).copy(cr, uid, id, default, context)