Add relate from report to translations
issue6057 review26901002
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
* Add relate from report to translations
|
||||
|
||||
Version 4.2.0 - 2016-11-28
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
* Add toolbar attribute for richtext widget
|
||||
|
||||
@@ -93,6 +93,7 @@ def register():
|
||||
TranslationClean,
|
||||
TranslationUpdate,
|
||||
TranslationExport,
|
||||
TranslationReport,
|
||||
ShowView,
|
||||
PrintModelGraph,
|
||||
ModuleConfigWizard,
|
||||
|
||||
@@ -36,6 +36,7 @@ __all__ = ['Translation',
|
||||
'TranslationCleanStart', 'TranslationCleanSucceed', 'TranslationClean',
|
||||
'TranslationUpdateStart', 'TranslationUpdate',
|
||||
'TranslationExportStart', 'TranslationExportResult', 'TranslationExport',
|
||||
'TranslationReport',
|
||||
]
|
||||
|
||||
TRANSLATION_TYPE = [
|
||||
@@ -1698,3 +1699,28 @@ class TranslationExport(Wizard):
|
||||
return {
|
||||
'file': cast(file_) if file_ else None,
|
||||
}
|
||||
|
||||
|
||||
class TranslationReport(Wizard):
|
||||
"Open translations of report"
|
||||
__name__ = 'ir.translation.report'
|
||||
start_state = 'open_'
|
||||
open_ = StateAction('ir.act_translation_report')
|
||||
|
||||
def do_open_(self, action):
|
||||
pool = Pool()
|
||||
Report = pool.get('ir.action.report')
|
||||
context = Transaction().context
|
||||
assert context['active_model'] == Report.__name__
|
||||
reports = Report.browse(context['active_ids'])
|
||||
action['pyson_domain'] = PYSONEncoder().encode([
|
||||
('type', '=', 'report'),
|
||||
('name', 'in', [r.report_name for r in reports]),
|
||||
])
|
||||
# Behaves like a relate to have name suffix
|
||||
action['keyword'] = 'form_relate'
|
||||
return action, {
|
||||
'model': context['active_model'],
|
||||
'ids': context['active_ids'],
|
||||
'id': context['active_id'],
|
||||
}
|
||||
|
||||
@@ -33,6 +33,21 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<menuitem name="Translations" parent="menu_localization"
|
||||
action="act_translation_form" id="menu_translation_form"/>
|
||||
|
||||
<record model="ir.action.wizard" id="wizard_translation_report">
|
||||
<field name="name">Translations</field>
|
||||
<field name="wiz_name">ir.translation.report</field>
|
||||
<field name="model">ir.action.report</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword" id="wizard_translation_report_keyword1">
|
||||
<field name="keyword">form_relate</field>
|
||||
<field name="model">ir.action.report,-1</field>
|
||||
<field name="action" ref="wizard_translation_report"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window" id="act_translation_report">
|
||||
<field name="name">Translations</field>
|
||||
<field name="res_model">ir.translation</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.translation" id="translation_delete_xml_record">
|
||||
<field name="name">delete_xml_record</field>
|
||||
<field name="lang">en</field>
|
||||
|
||||
Reference in New Issue
Block a user