changeset 177b48fb4e8c in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset;node=177b48fb4e8c
description:
Add filename to translation export wizard
issue9216
review279011002
diffstat:
trytond/ir/translation.py | 8 +++++++-
trytond/ir/view/translation_export_result_form.xml | 6 +++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diffs (41 lines):
diff -r 854012242629 -r 177b48fb4e8c trytond/ir/translation.py
--- a/trytond/ir/translation.py Mon Apr 13 20:47:17 2020 +0200
+++ b/trytond/ir/translation.py Mon Apr 13 23:49:48 2020 +0200
@@ -1545,7 +1545,10 @@
"Export translation"
__name__ = 'ir.translation.export.result'
- file = fields.Binary('File', readonly=True)
+ language = fields.Many2One('ir.lang', 'Language', readonly=True)
+ module = fields.Many2One('ir.module', 'Module', readonly=True)
+ file = fields.Binary('File', readonly=True, filename='filename')
+ filename = fields.Char('Filename')
class TranslationExport(Wizard):
@@ -1575,7 +1578,10 @@
cast = self.result.__class__.file.cast
self.result.file = False # No need to store it in session
return {
+ 'module': self.start.module.id,
+ 'language': self.start.language.id,
'file': cast(file_) if file_ else None,
+ 'filename': '%s.po' % self.start.language.code,
}
diff -r 854012242629 -r 177b48fb4e8c
trytond/ir/view/translation_export_result_form.xml
--- a/trytond/ir/view/translation_export_result_form.xml Mon Apr 13
20:47:17 2020 +0200
+++ b/trytond/ir/view/translation_export_result_form.xml Mon Apr 13
23:49:48 2020 +0200
@@ -2,6 +2,10 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form>
+ <label name="language"/>
+ <field name="language"/>
+ <label name="module"/>
+ <field name="module"/>
<label name="file"/>
- <field name="file"/>
+ <field name="file" colspan="3"/>
</form>