'Get the ir.action related to update the goal
In case of a manual goal, should return a wizard to update the value
:return: action description in a dictionary'

@api.multi
def get_action(self):

    if self.definition_id.action_id:
        action = self.definition_id.action_id.read()[0]
        if self.definition_id.res_id_field:
            current_user = self.env.user.sudo(self.env.user)
            action['res_id'] = safe_eval(self.definition_id.res_id_field, {'user': current_user})
            action['views'] = ([(view_id, mode) for (view_id, mode) in action['views'] if (mode == 'form')] or action['views'])
        return action
    if (self.computation_mode == 'manually'):
        action = {'name': (_('Update    %s') % self.definition_id.name), 'id': self.id, 'type': 'ir.actions.act_window', 'views': [[False, 'form']], 'target': 'new', 'context': {'default_goal_id': self.id, 'default_current': self.current}, 'res_model': 'gamification.goal.wizard'}
        return action
    return False
