Allow non translatable reports

issue4033
review56361002
This commit is contained in:
Sergi Almacellas Abellana
2018-09-07 16:23:52 +02:00
parent 12f6582e08
commit 3c80cfd8c4
4 changed files with 19 additions and 8 deletions
+1
View File
@@ -1,3 +1,4 @@
* Allow non translatable reports
* Replace hard coded 'state' by '_transition_state' in copy
* Support dotted notation in copy default
* Allow callable in copy default
+6
View File
@@ -402,6 +402,8 @@ class ActionReport(ActionMixin, ModelSQL, ModelView):
direct_print = fields.Boolean('Direct Print')
single = fields.Boolean("Single",
help="Check if the template works only for one record.")
translatable = fields.Boolean("Translatable",
help="Uncheck to disable translations for this report.")
template_extension = fields.Selection([
('odt', 'OpenDocument Text'),
('odp', 'OpenDocument Presentation'),
@@ -527,6 +529,10 @@ class ActionReport(ActionMixin, ModelSQL, ModelView):
def default_single(cls):
return False
@classmethod
def default_translatable(cls):
return True
@staticmethod
def default_template_extension():
return 'odt'
+2 -1
View File
@@ -1008,7 +1008,7 @@ class TranslationSet(Wizard):
reports = Report.browse(context.get('active_ids', []))
elif context.get('active_model', 'ir.ui.menu') == 'ir.ui.menu':
with Transaction().set_context(active_test=False):
reports = Report.search([])
reports = Report.search([('translatable', '=', True)])
else:
return
@@ -1253,6 +1253,7 @@ class TranslationClean(Wizard):
with Transaction().set_context(active_test=False):
if not Report.search([
('report_name', '=', translation.name),
('translatable', '=', True),
]):
return True
+10 -7
View File
@@ -4,8 +4,16 @@ this repository contains the full copyright notices and license terms. -->
<form>
<label name="name"/>
<field name="name"/>
<label name="active"/>
<field name="active" xexpand="0" width="100"/>
<group id="checkboxes" colspan="2" col="-1">
<label name="active"/>
<field name="active" xexpand="0" width="25"/>
<label name="translatable"/>
<field name="translatable" xexpand="0" width="25"/>
<label name="single"/>
<field name="single" xexpand="0" width="25"/>
<label name="direct_print"/>
<field name="direct_print" xexpand="0" width="25"/>
</group>
<notebook colspan="4">
<page string="General" id="general">
<label name="model"/>
@@ -23,11 +31,6 @@ this repository contains the full copyright notices and license terms. -->
<field name="template_extension"/>
<label name="extension"/>
<field name="extension"/>
<label name="single"/>
<field name="single"/>
<label name="direct_print"/>
<field name="direct_print"/>
<newline/>
<label name="email"/>
<field name="email" colspan="3" widget="pyson"/>
</page>