Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
3 Replies
4506 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
3
Apr 15
9043
0
Des 24
861
0
Sep 24
1378
2
Mar 24
3014
2
Feb 23
3575