'Returns the potential field types, based on the preview values, using heuristics
:param preview_values : list of value for the column to determine
:param options : parsing options'

@api.model
def _try_match_column(self, preview_values, options):

    if all([(v == '') for v in preview_values]):
        return ['all']
    if all((v.startswith('__export__') for v in preview_values)):
        return ['id', 'many2many', 'many2one', 'one2many']
    try:
        field_type = ['id', 'integer', 'float', 'monetary', 'many2one', 'many2many', 'one2many']
        res = set((int(v) for v in preview_values))
        if {0, 1}.issuperset(res):
            field_type.append('boolean')
        return field_type
    except ValueError:
        pass
    if all(((val.lower() in ('true', 'false', 't', 'f', '')) for val in preview_values)):
        return ['boolean']
    try:
        thousand_separator = decimal_separator = False
        for val in preview_values:
            if (val == ''):
                continue
            val = self._remove_currency_symbol(val)
            if val:
                if (options.get('float_thousand_separator') and options.get('float_decimal_separator')):
                    val = val.replace(options['float_thousand_separator'], '').replace(options['float_decimal_separator'], '.')
                elif (val.count('.') > 1):
                    options['float_thousand_separator'] = '.'
                    options['float_decimal_separator'] = ','
                elif (val.count(',') > 1):
                    options['float_thousand_separator'] = ','
                    options['float_decimal_separator'] = '.'
                elif (val.find('.') > val.find(',')):
                    thousand_separator = ','
                    decimal_separator = '.'
                elif (val.find(',') > val.find('.')):
                    thousand_separator = '.'
                    decimal_separator = ','
            else:
                float('a')
        if (thousand_separator and (not options.get('float_decimal_separator'))):
            options['float_thousand_separator'] = thousand_separator
            options['float_decimal_separator'] = decimal_separator
        return ['float', 'monetary']
    except ValueError:
        pass
    dt = datetime.datetime
    separator = ['    ', '/', '-']
    date_format = ['%mr%dr%Y', '%dr%mr%Y', '%Yr%mr%d', '%Yr%dr%m']
    date_patterns = ([options['date_format']] if options.get('date_format') else [])
    if (not date_patterns):
        date_patterns = [pattern.replace('r', sep) for sep in separator for pattern in date_format]
        date_patterns.extend([p.replace('Y', 'y') for p in date_patterns])
    datetime_patterns = ([options['datetime_format']] if options.get('datetime_format') else [])
    if (not datetime_patterns):
        datetime_patterns = [(pattern + '    %H:%M:%S') for pattern in date_patterns]
    current_date_pattern = False
    current_datetime_pattern = False
    def check_patterns(patterns, preview_values):
        for pattern in patterns:
            match = True
            for val in preview_values:
                if (not val):
                    continue
                try:
                    dt.strptime(val, pattern)
                except ValueError:
                    match = False
                    break
            if match:
                return pattern
        return False
    current_date_pattern = check_patterns(date_patterns, preview_values)
    if current_date_pattern:
        options['date_format'] = current_date_pattern
        return ['date']
    current_datetime_pattern = check_patterns(datetime_patterns, preview_values)
    if current_datetime_pattern:
        options['datetime_format'] = current_datetime_pattern
        return ['datetime']
    return ['text', 'char', 'datetime', 'selection', 'many2one', 'one2many', 'many2many', 'html']
