[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
This commit is contained in:
Chris Halls
2010-04-16 16:24:29 +01:00
parent 39cc553508
commit bb5d7cf572
+6 -2
View File
@@ -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)