[FIX] stock: fixed notification sending on picking when there was no picking

bzr revid: tde@openerp.com-20120403135237-743ltm3vbl0j8u93
This commit is contained in:
Thibault Delavallée 2012-04-03 15:52:37 +02:00
parent a85efef0b6
commit ce7c893639
1 changed files with 3 additions and 2 deletions

View File

@ -2397,8 +2397,9 @@ class stock_move(osv.osv):
res += [new_move]
product_obj = self.pool.get('product.product')
for product in product_obj.browse(cr, uid, [move.product_id.id], context=context):
uom = product.uom_id.name if product.uom_id else ''
move.picking_id.scrap_send_note(quantity, uom, product.name, context=context)
if move.picking_id:
uom = product.uom_id.name if product.uom_id else ''
move.picking_id.scrap_send_note(quantity, uom, product.name, context=context)
self.action_done(cr, uid, res, context=context)
return res