Better selection of picking type

This commit is contained in:
Alexis de Lattre
2017-02-09 14:09:41 +01:00
parent aafc36dfdb
commit 662494db35

View File

@@ -277,12 +277,16 @@ class PurchaseSuggestPoCreate(models.TransientModel):
('warehouse_id.company_id', '=', company.id)]
pick_types = spto.search(
pick_type_dom + [(
'default_location_dest_id',
'child_of',
location.location_id.id)])
'default_location_dest_id', 'child_of', location.id)])
# I use location.parent_id.id to support 2 step-receptions
# where the stock.location .type is linked to Warehouse > Receipt
# but location is Warehouse > Stock
if not pick_types:
pick_types = spto.search(
pick_type_dom + [(
'default_location_dest_id',
'child_of',
location.location_id.id)])
if not pick_types:
pick_types = spto.search(pick_type_dom)
if not pick_types: