Use translated values when exporting Reference and Selection fields

issue6961
review37841002
This commit is contained in:
Sergi Almacellas Abellana
2017-11-27 10:38:12 +01:00
parent 7eefd92994
commit 4845b56f36
2 changed files with 12 additions and 1 deletions
+2
View File
@@ -1,3 +1,5 @@
* Use translated values when exporting Reference and Selection fields
Version 4.6.0 - 2017-10-30
* Bug fixes (see mercurial logs for details)
* Allow to export model and record name of Reference fields
+10 -1
View File
@@ -1328,8 +1328,17 @@
this.context = context;
Sao.Window.Export._super.init.call(this,
Sao.i18n.gettext('Export to CSV')).then(function() {
var fields = this.screen.model.fields;
names.forEach(function(name) {
this.sel_field(name);
var type = fields[name].description.type;
if (type == 'selection') {
this.sel_field(name + '.translated');
} else if (type == 'reference') {
this.sel_field(name + '.translated');
this.sel_field(name + '/rec_name');
} else {
this.sel_field(name);
}
}.bind(this));
}.bind(this));