Browse Source

[FIX] report_py3o: Removes api.one

14.0-report-py3o-pr-506
Omar 7 years ago
committed by default
parent
commit
0f6ea03ed3
  1. 27
      report_py3o/models/ir_actions_report_xml.py

27
report_py3o/models/ir_actions_report_xml.py

@ -23,25 +23,26 @@ class IrActionsReportXml(models.Model):
_inherit = 'ir.actions.report.xml'
@api.one
@api.multi
@api.constrains("py3o_filetype", "report_type")
def _check_py3o_filetype(self):
if self.report_type == "py3o" and not self.py3o_filetype:
raise ValidationError(_(
"Field 'Output Format' is required for Py3O report"))
for report in self:
if report.report_type == "py3o" and not report.py3o_filetype:
raise ValidationError(_(
"Field 'Output Format' is required for Py3O report"))
@api.one
@api.multi
@api.constrains("py3o_is_local_fusion", "py3o_server_id",
"py3o_filetype")
def _check_py3o_server_id(self):
if self.report_type != "py3o":
return
is_native = Formats().get_format(self.py3o_filetype).native
if ((not is_native or not self.py3o_is_local_fusion) and
not self.py3o_server_id):
raise ValidationError(_(
"Can not use not native format in local fusion. "
"Please specify a Fusion Server"))
for report in self:
if report.report_type == "py3o":
is_native = Formats().get_format(report.py3o_filetype).native
if ((not is_native or not report.py3o_is_local_fusion) and
not report.py3o_server_id):
raise ValidationError(_(
"Can not use not native format in local fusion. "
"Please specify a Fusion Server"))
@api.model
def _get_py3o_filetypes(self):

Loading…
Cancel
Save