Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
4483 Vistas

Hello.

I need to export data from invoices by sequence. The list view  of invoices doesn't have a sequence ordering column, so I searched for another view with sequece column and I found the journals view. There I exported the data, then I reordered it by sequence but after I exported again both .xls documents show the data in the same order. 

I really need to find out how to export the data by sequence order. I would appreciate your help.

Avatar
Descartar
Mejor respuesta

I had the same problem. I had to export a large number of invoices, sorted by number.

I was not able doing that from UI.

I had to patch the file addons/web/main.py, class ExportFormat, method base(), from


    records = Model.browse(ids) or Model.search(domain, offset=0, limit=False, order=False)

to


    if ids:
            ids=sorted(ids)
    records = Model.browse(ids) or Model.search(domain, offset=0, limit=False, order="id asc")


Instead of "id asc" you may try "number asc" or "name asc".

Of course this patch impacts on all exports not only invoices

Avatar
Descartar
Mejor respuesta

I had a similar problem where I was exporting journal entries together with journal items. I first sorted the data on the screen by date. However, when I exported the sort was not applied. Since there were several rows with fields without any data (parent/child record), it was impossible to sort it on excel. 

To overcome the problem, I used group by date and number. When I did this, the resulting excel showed me data sorted on both fields.

I hope it helps.


Avatar
Descartar
Mejor respuesta

The most accurate field to sort data is Database ID field. You can select to export all data to be able add it to the exported fields. So, you will be able to sort data using this column.


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
3
abr 15
9024
0
dic 24
856
0
sept 24
1373
2
mar 24
3002
2
feb 23
3564