Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
3 Vastaukset
4489 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Paras vastaus

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
Hylkää
Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
3
huhtik. 15
9028
0
jouluk. 24
856
0
syysk. 24
1373
2
maalisk. 24
3007
2
helmik. 23
3566