[FIX] Take into account that location_id of routing can be empty

This commit is contained in:
Josse Colpaert 2014-06-25 18:17:32 +02:00
parent 8678d3c890
commit 89041fafce
1 changed files with 1 additions and 1 deletions

View File

@ -1092,7 +1092,7 @@ class mrp_production(osv.osv):
# Take routing location as a Source Location.
source_location_id = production.location_src_id.id
prev_move= False
if production.bom_id.routing_id and production.bom_id.routing_id.location_id.id != source_location_id:
if production.bom_id.routing_id and production.bom_id.routing_id.location_id and production.bom_id.routing_id.location_id.id != source_location_id:
source_location2_id = source_location_id
source_location_id = production.bom_id.routing_id.location_id.id
prev_move = self._create_previous_move(cr, uid, production, product, uom_id, qty, uos_id, uos_qty, source_location2_id, source_location_id, context=context)