Issue 9301

Title
Wrong header when exporting from the print toolbar
Priority
feature
Status
resolved
Superseder
Export CSV not translate header when export by printer icon (issue 11444)
Nosy list
Davidoff, ced, pokoli, reviewbot, roundup-bot
Assigned to
pokoli
Keywords
review

Created on 2020-05-06.10:52:28 by pokoli, last changed 5 months ago by roundup-bot.

Messages

New changeset c227f8c05097 by Sergi Almacellas Abellana in branch 'default':
Add header parameter on export data
https://hg.tryton.org/tryton-env/rev/c227f8c05097
New changeset 6abb3942043f by Sergi Almacellas Abellana in branch 'default':
Add header parameter on export data
https://hg.tryton.org/trytond/rev/6abb3942043f
New changeset b5a89e6c45ad by Sergi Almacellas Abellana in branch 'default':
Add header parameter on export data
https://hg.tryton.org/tryton/rev/b5a89e6c45ad
New changeset 2fe23af89625 by Sergi Almacellas Abellana in branch 'default':
Add header parameter on export data
https://hg.tryton.org/sao/rev/2fe23af89625
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2022-05-25.17:38:22

I uploaded review439151003 which implements what we discussed on last messages.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-05-24.15:03:27
On 2022-05-24 14:42, Sergi Almacellas Abellana wrote:
> IIUC what you propose is to always generate the field names in server side. Right? 

Yes.

> We already have a flag on the export dialog to include the field names or not. Do you think using this flag is enought or we should use another to indicate if the fields should be translated or not? 

I think there is enough flexibility with a single flag and the
contextual language.

> We should take in account that there is also the export route which already have a header flag and now includes also the `field_names`. I think it will be a good idea to also include the field description in such fields. Does it make sense?

The route should also have a flag to include or not the header.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2022-05-24.14:42:34

IIUC what you propose is to always generate the field names in server side. Right?

We already have a flag on the export dialog to include the field names or not. Do you think using this flag is enought or we should use another to indicate if the fields should be translated or not?
For me the best is to always include the translated description.

We should take in account that there is also the export route which already have a header flag and now includes also the field_names. I think it will be a good idea to also include the field description in such fields. Does it make sense?

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-03-30.00:09:04

I think my proposal on msg61145 was not the best option because it prevent to have this behavior also on the export dialog.
Indeed I think we could use a context flag for ModelStorage.export_data that convert or not the fields_names into strings. As we are on the Model we can use the _fields attribute for nested fields and still use ModelField.get_name for cache.
Also we will need to add a flag on the export dialog and save it to ir.export (and re-use the value for the print toolbar).

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-10-22.00:16:55

For me it is not a bug but a design choice.
This could be solved by adding a function field on ir.export.line that would compute the description of the nested name.

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2020-05-06.10:52:27
Since issue8130 it is possible to run an export from the print option but when exporting from there the internal representation of the names are used instead of the field description (like done from the export wizard).

I think on both cases the field description (which is in the user language) should be used.
History
Date User Action Args
2022-07-01 12:49:12roundup-botsetmessages: + msg77264
2022-07-01 12:49:03roundup-botsetmessages: + msg77263
2022-07-01 12:48:57roundup-botsetmessages: + msg77262
2022-07-01 12:48:51roundup-botsetmessages: + msg77261
nosy: + roundup-bot
status: testing -> resolved
2022-06-27 16:07:27reviewbotsetmessages: + msg77236
2022-06-20 12:35:17reviewbotsetmessages: + msg77137
2022-06-17 13:56:50reviewbotsetmessages: + msg77131
2022-05-25 17:52:19reviewbotsetmessages: + msg76793
2022-05-25 17:38:52pokolisetreviews: 370091002,439151003 -> 439151003
2022-05-25 17:38:22pokolisetmessages: + msg76788
reviews: 370091002 -> 370091002,439151003

Showing 10 items. Show all history (warning: this could be VERY long)