From 4a20342dc85ad5089989c534754138b8d6a2f1ff Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Thu, 18 Mar 2010 12:42:23 +0530 Subject: [PATCH] [IMP] stock: Added a warning message for user if the moves are not confirmed on Picking. bzr revid: uco@tinyerp.co.in-20100318071223-g19vrebxjv930xta --- addons/stock/stock.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d2653e39b07..1cd2e412c61 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -546,6 +546,8 @@ class stock_picking(osv.osv): def action_assign(self, cr, uid, ids, *args): for pick in self.browse(cr, uid, ids): move_ids = [x.id for x in pick.move_lines if x.state == 'confirmed'] + if not move_ids: + raise osv.except_osv(_('Warning !'),_('Not Available. Moves are not confirmed.')) self.pool.get('stock.move').action_assign(cr, uid, move_ids) return True @@ -1279,7 +1281,7 @@ class stock_move(osv.osv): if done: count += len(done) self.write(cr, uid, done, {'state': 'assigned'}) - + if count: for pick_id in pickings: wf_service = netsvc.LocalService("workflow")