'Check availability of picking moves.
This has the effect of changing the state and reserve quants on available moves, and may
also impact the state of the picking as it is computed based on move\'s states.
@return: True'

@api.multi
def action_assign(self):

    self.filtered((lambda picking: (picking.state == 'draft'))).action_confirm()
    moves = self.mapped('move_lines').filtered((lambda move: (move.state not in ('draft', 'cancel', 'done'))))
    if (not moves):
        raise UserError(_('Nothing    to    check    the    availability    for.'))
    moves.action_assign()
    return True
