Browse Source

[FIX] report_py3o: Removes api.one

pull/172/head
Omar 7 years ago
parent
commit
be3bd5bf6e
  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' _inherit = 'ir.actions.report.xml'
@api.one
@api.multi
@api.constrains("py3o_filetype", "report_type") @api.constrains("py3o_filetype", "report_type")
def _check_py3o_filetype(self): 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", @api.constrains("py3o_is_local_fusion", "py3o_server_id",
"py3o_filetype") "py3o_filetype")
def _check_py3o_server_id(self): 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 @api.model
def _get_py3o_filetypes(self): def _get_py3o_filetypes(self):

Loading…
Cancel
Save