'If user applies any filters, then this function returns list of
filtered user_input_id and label\'s strings for display data in web.
:param filters: list of dictionary (having: row_id, ansewr_id)
:param finished: True for completely filled survey,Falser otherwise.
:returns list of filtered user_input_ids.'

@api.multi
def filter_input_ids(self, filters, finished=False):

    self.ensure_one()
    if filters:
        (domain_filter, choice) = ([], [])
        for current_filter in filters:
            (row_id, answer_id) = (current_filter['row_id'], current_filter['answer_id'])
            if (row_id == 0):
                choice.append(answer_id)
            else:
                domain_filter.extend(['|', ('value_suggested_row.id', '=', row_id), ('value_suggested.id', '=', answer_id)])
        if choice:
            domain_filter.insert(0, ('value_suggested.id', 'in', choice))
        else:
            domain_filter = domain_filter[1:]
        input_lines = self.env['survey.user_input_line'].search(domain_filter)
        filtered_input_ids = [input_line.user_input_id.id for input_line in input_lines]
    else:
        filtered_input_ids = []
    if finished:
        UserInput = self.env['survey.user_input']
        if (not filtered_input_ids):
            user_inputs = UserInput.search([('survey_id', '=', self.id)])
        else:
            user_inputs = UserInput.browse(filtered_input_ids)
        return user_inputs.filtered((lambda input_item: (input_item.state == 'done'))).ids
    return filtered_input_ids
