diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 9bd50ea9c8d..ac5b5e11088 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -641,7 +641,7 @@ class stock_picking(osv.osv): '''The state of a picking depends on the state of its related stock.move draft: the picking has no line or any one of the lines is draft done, draft, cancel: all lines are done / draft / cancel - confirmed, auto, assigned depends on move_type (all at once or direct) + confirmed, waiting, assigned, partially_available depends on move_type (all at once or partial) ''' res = {} for pick in self.browse(cr, uid, ids, context=context): @@ -666,11 +666,14 @@ class stock_picking(osv.osv): #in partially available state, otherwise, picking is in waiting or confirmed state res[pick.id] = order_inv[max(lst)] if not all(x == 2 for x in lst): - #if all moves aren't assigned, check if we have one product partially available - for move in pick.move_lines: - if move.partially_available: - res[pick.id] = 'partially_available' - break + if any(x == 2 for x in lst): + res[pick.id] = 'partially_available' + else: + #if all moves aren't assigned, check if we have one product partially available + for move in pick.move_lines: + if move.partially_available: + res[pick.id] = 'partially_available' + break return res def _get_pickings(self, cr, uid, ids, context=None): @@ -3352,7 +3355,7 @@ class stock_location_path(osv.osv): } _defaults = { 'auto': 'auto', - 'delay': 1, + 'delay': 0, 'invoice_state': 'none', 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'procurement.order', context=c), 'propagate': True, diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index f1c0bb5c1a9..fed76e5e78d 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -673,8 +673,8 @@