Browse Source

[FIX] report_py3o: Removes api.one

pull/258/head
Omar 7 years ago
committed by Laurent Mignon (ACSONE)
parent
commit
780cef9898
  1. 17
      report_py3o/models/ir_actions_report_xml.py

17
report_py3o/models/ir_actions_report_xml.py

@ -23,22 +23,23 @@ 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:
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):
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"))

Loading…
Cancel
Save