[FIX] stock: chained location type `Customers` was not working at all for pickings without partner

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
This commit is contained in:
Olivier Dony 2013-11-07 11:53:02 +01:00
parent f378aaa0a7
commit 05e067415d
1 changed files with 3 additions and 0 deletions

View File

@ -241,6 +241,9 @@ class stock_location(osv.osv):
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: