commit
aeb904b31f
|
@ -47,11 +47,24 @@ class IrActionsReport(models.Model):
|
||||||
selections.append((name, description))
|
selections.append((name, description))
|
||||||
return selections
|
return selections
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _default_py3o_filetypes(self):
|
||||||
|
formats = Formats()
|
||||||
|
names = formats.get_known_format_names()
|
||||||
|
selections = []
|
||||||
|
for name in names:
|
||||||
|
description = name
|
||||||
|
if formats.get_format(name).native:
|
||||||
|
description = description + " " + _("(Native)")
|
||||||
|
selections.append((name, description))
|
||||||
|
return selections[0][0]
|
||||||
|
|
||||||
report_type = fields.Selection(
|
report_type = fields.Selection(
|
||||||
selection_add=[("py3o", "py3o")]
|
selection_add=[("py3o", "py3o")]
|
||||||
)
|
)
|
||||||
py3o_filetype = fields.Selection(
|
py3o_filetype = fields.Selection(
|
||||||
selection="_get_py3o_filetypes",
|
selection="_get_py3o_filetypes",
|
||||||
|
default=_default_py3o_filetypes,
|
||||||
string="Output Format")
|
string="Output Format")
|
||||||
is_py3o_native_format = fields.Boolean(
|
is_py3o_native_format = fields.Boolean(
|
||||||
compute='_compute_is_py3o_native_format'
|
compute='_compute_is_py3o_native_format'
|
||||||
|
@ -79,13 +92,13 @@ class IrActionsReport(models.Model):
|
||||||
lo_bin_path = fields.Char(
|
lo_bin_path = fields.Char(
|
||||||
string="Path to the libreoffice runtime",
|
string="Path to the libreoffice runtime",
|
||||||
compute="_compute_lo_bin_path"
|
compute="_compute_lo_bin_path"
|
||||||
)
|
)
|
||||||
is_py3o_report_not_available = fields.Boolean(
|
is_py3o_report_not_available = fields.Boolean(
|
||||||
compute='_compute_py3o_report_not_available'
|
compute='_compute_py3o_report_not_available'
|
||||||
)
|
)
|
||||||
msg_py3o_report_not_available = fields.Char(
|
msg_py3o_report_not_available = fields.Char(
|
||||||
compute='_compute_py3o_report_not_available'
|
compute='_compute_py3o_report_not_available'
|
||||||
)
|
)
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _register_hook(self):
|
def _register_hook(self):
|
||||||
|
|
Loading…
Reference in New Issue