This can create inconsistencies in the warehouse inventory
in case delivery orders are not customer-specific, e.g.
when using the POS.
When there is no destination customer we can still use
the default Customers locations.
bzr revid: odo@openerp.com-
20131107105302-hf8lublc1x3qc87h
if location.chained_location_type == 'customer':
if partner:
result = partner.property_stock_customer
+ else:
+ loc_id = self.pool['res.partner'].default_get(cr, uid, ['property_stock_customer'], context=context)['property_stock_customer']
+ result = self.pool['stock.location'].browse(cr, uid, loc_id, context=context)
elif location.chained_location_type == 'fixed':
result = location.chained_location_id
if result: