return res
if 'move_ids' in fields:
move_ids = self.pool.get('stock.move').browse(cr, uid, move_ids, context=context)
- moves = [self._partial_move_for(cr, uid, m) for m in move_ids if m.state not in ('done','cancel')]
+ moves = [self._partial_move_for(cr, uid, m, context=context) for m in move_ids 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))
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 not in ('done','cancel')]
+ moves = [self._partial_move_for(cr, uid, m, context=context) 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))
return {'cost': move.product_id.standard_price,
'currency': product_currency_id or picking_currency_id or False}
- def _partial_move_for(self, cr, uid, move):
+ def _partial_move_for(self, cr, uid, move, context=None):
partial_move = {
'product_id' : move.product_id.id,
'quantity' : move.product_qty if move.state == 'assigned' or move.picking_id.type == 'in' else 0,