'Export fields of the records in ``self``.
:param fields: list of lists of fields to traverse
:return: list of lists of corresponding values'

@api.multi
def _export_rows(self, fields):

    lines = []
    for record in self:
        current = ([''] * len(fields))
        lines.append(current)
        primary_done = []
        for (i, path) in enumerate(fields):
            if (not path):
                continue
            name = path[0]
            if (name in primary_done):
                continue
            if (name == '.id'):
                current[i] = str(record.id)
            elif (name == 'id'):
                current[i] = record.__export_xml_id()
            else:
                field = record._fields[name]
                value = record[name]
                if (not isinstance(value, BaseModel)):
                    current[i] = field.convert_to_export(value, record)
                else:
                    primary_done.append(name)
                    if ((field.type == 'many2many') and (len(path) > 1) and (path[1] == 'id')):
                        xml_ids = [r.__export_xml_id() for r in value]
                        current[i] = (','.join(xml_ids) or False)
                        continue
                    fields2 = [(p[1:] if (p and (p[0] == name)) else []) for p in fields]
                    lines2 = value._export_rows(fields2)
                    if lines2:
                        for (j, val) in enumerate(lines2[0]):
                            if (val or isinstance(val, bool)):
                                current[j] = val
                        if ((not current[i]) and (not isinstance(current[i], bool))):
                            xml_ids = [item[1] for item in value.name_get()]
                            current[i] = ','.join(xml_ids)
                        else:
                            lines += lines2[1:]
                    else:
                        current[i] = False
    return lines
