From 8fcfcfbfa54e09fc7327b3adf76fb09d543c833b Mon Sep 17 00:00:00 2001 From: Pierre Monod Date: Thu, 26 Apr 2012 19:56:47 +0200 Subject: [PATCH] internediate saved version for voltalis --- stock_tracking_extended/stock_tracking.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stock_tracking_extended/stock_tracking.py b/stock_tracking_extended/stock_tracking.py index e9ba9f33c..1a2ba49c0 100644 --- a/stock_tracking_extended/stock_tracking.py +++ b/stock_tracking_extended/stock_tracking.py @@ -280,9 +280,19 @@ stock_inventory() class stock_move(osv.osv): _inherit = 'stock.move' _columns = { + 'move_ori_id': fields.many2one('stock.move', 'Origin Move', select=True), # 'cancel_cascade': fields.boolean('Cancel Cascade', help='If checked, when this move is cancelled, cancel the linked move too') } + def write(self, cr, uid, ids, vals, context=None): + result = super(stock_move,self).write(cr, uid, ids, vals, context) + for id in ids: + state = self.browse(cr, uid, id, context).state + move_ori_id = self.browse(cr, uid, id, context).move_ori_id + if state == 'done' and move_ori_id: + self.write(cr, uid, [move_ori_id], {'state':'done'}, context) + return result + def create(self, cr, uid, vals, context=None): production_lot_obj = self.pool.get('stock.production.lot') stock_tracking_obj = self.pool.get('stock.tracking')