'Copy given record\'s data with all its fields values
:param default: field values to override in the original values of the copied record
:return: list with a dictionary containing all the field values'

@api.multi
@api.returns(None, (lambda value: value[0]))
def copy_data(self, default=None):

    self.ensure_one()
    if ('__copy_data_seen' not in self._context):
        self = self.with_context(__copy_data_seen=defaultdict(set))
    seen_map = self._context['__copy_data_seen']
    if (self.id in seen_map[self._name]):
        return
    seen_map[self._name].add(self.id)
    default = dict((default or []))
    if (('state' not in default) and ('state' in self._fields)):
        field = self._fields['state']
        if field.default:
            value = field.default(self)
            value = field.convert_to_cache(value, self)
            value = field.convert_to_record(value, self)
            value = field.convert_to_write(value, self)
            default['state'] = value
    blacklist = set((MAGIC_COLUMNS + ['parent_left', 'parent_right']))
    whitelist = set((name for (name, field) in self._fields.iteritems() if (not field.inherited)))
    def blacklist_given_fields(model):
        for (parent_model, parent_field) in model._inherits.items():
            blacklist.add(parent_field)
            if (parent_field in default):
                blacklist.update((set(self.env[parent_model]._fields) - whitelist))
            else:
                blacklist_given_fields(self.env[parent_model])
        for (name, field) in model._fields.iteritems():
            if field.deprecated:
                blacklist.add(name)
    blacklist_given_fields(self)
    fields_to_copy = {name: field for (name, field) in self._fields.iteritems() if (field.copy and (name not in default) and (name not in blacklist))}
    for (name, field) in fields_to_copy.iteritems():
        if (field.type == 'one2many'):
            lines = [rec.copy_data()[0] for rec in self[name].sorted(key='id')]
            default[name] = [(0, 0, line) for line in lines if line]
        elif (field.type == 'many2many'):
            default[name] = [(6, 0, self[name].ids)]
        else:
            default[name] = field.convert_to_write(self[name], self)
    return [default]
