Use translated values when exporting Reference and Selection fields

issue6961
review42861002
This commit is contained in:
Sergi Almacellas Abellana committed 2017-11-27 10:37:47 +01:00
1 parent dd08c7b187
commit ce6e099fae
2 files changed
+10 -1

No files matched your search

+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
+8 -1
View File
@@ -280,7 +280,14 @@ class Form(SignalEvent, TabContent):
[r.id for r in self.screen.selected_records],
context=self.screen.context)
for name in self.screen.current_view.get_fields():
export.sel_field(name)
type = self.screen.group.fields[name].attrs['type']
if type == 'selection':
export.sel_field(name + '.translated')
elif type == 'reference':
export.sel_field(name + '.translated')
export.sel_field(name + '/rec_name')
else:
export.sel_field(name)
def sig_new(self, widget=None, autosave=True):
if not common.MODELACCESS[self.model]['create']: