[FIX] stock, partial picking: reverted fix of bug 833770 (made in revision 5413) to implement it in another way. The reason is that if you want to process a picking that is partially available, you have several solutions: you can force the availability of unready lines but it means that if you partially process those lines, the quantity not processed will stay with the status 'available', or you can just allow people to see also the unready lines in the partial picking wizard.... but, in order to have a smooth processing for most of the cases, the unassigned lines will be with a quantity of 0, so that if you don't change anything it will process only available lines, and if you want to partially process an unavailable line, then you still have the opportunity to do so. This approach is much more flexible.

bzr revid: qdp-launchpad@openerp.com-20111020102126-rizauy5k2gmrmdbj
This commit is contained in:
Quentin (OpenERP) 2011-10-20 12:21:26 +02:00
parent 278955b207
commit 6a7c1b1002
1 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ class stock_partial_picking(osv.osv_memory):
res.update(picking_id=picking_id)
if 'move_ids' in fields:
picking = self.pool.get('stock.picking').browse(cr, uid, picking_id, context=context)
moves = [self._partial_move_for(cr, uid, m) for m in picking.move_lines if m.state == 'assigned']
moves = [self._partial_move_for(cr, uid, m) for m in picking.move_lines if m.state not in ('done','cancel')]
res.update(move_ids=moves)
if 'date' in fields:
res.update(date=time.strftime(DEFAULT_SERVER_DATETIME_FORMAT))
@ -88,7 +88,7 @@ class stock_partial_picking(osv.osv_memory):
def _partial_move_for(self, cr, uid, move):
partial_move = {
'product_id' : move.product_id.id,
'quantity' : move.product_qty,
'quantity' : move.state == 'assigned' and move.product_qty or 0,
'product_uom' : move.product_uom.id,
'prodlot_id' : move.prodlot_id.id,
'move_id' : move.id,