[FIX] stock: error on stock.partial.move creation

The stock_partial_move wizard removes the required attribute for the field picking_id on a stock.partial.move. This means that we could get moves without picking_id and the previous line was failing ('NoneType' object has no attribute 'currency_id'). opw 614531
This commit is contained in:
Martin Trigaux 2014-09-24 10:27:40 +02:00
parent 9c77f794b4
commit 4a064b9374
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ class stock_partial_picking(osv.osv_memory):
'move_id' : move.id,
'location_id' : move.location_id.id,
'location_dest_id' : move.location_dest_id.id,
'currency': move.picking_id.company_id.currency_id.id,
'currency': move.picking_id and move.picking_id.company_id.currency_id.id or False,
}
if move.picking_id.type == 'in' and move.product_id.cost_method == 'average':
partial_move.update(update_cost=True, **self._product_cost_for_average_update(cr, uid, move))