From a54b002a98dc50c0c5f6036606f4cb6235055583 Mon Sep 17 00:00:00 2001 From: "rha@tinyerp.com" <> Date: Wed, 2 Feb 2011 17:47:37 +0530 Subject: [PATCH] [Fix]: stock: cancelling move availability doesn't change packing lp bug: https://launchpad.net/bugs/707031 fixed bzr revid: rha@tinyerp.com-20110202121737-y0mqh83pnetbwv9f --- addons/stock/stock.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index c942818a3d4..f0d6ca83b32 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1886,6 +1886,14 @@ class stock_move(osv.osv): @return: True """ self.write(cr, uid, ids, {'state': 'confirmed'}) + + # fix for bug lp:707031 + # called write of related picking because changing move availability does + # not trigger workflow of picking in order to change the state of picking + wf_service = netsvc.LocalService('workflow') + for move in self.browse(cr, uid, ids, context): + if move.picking_id: + wf_service.trg_write(uid, 'stock.picking', move.picking_id.id, cr) return True #