[FIX] report_py3o: Removes api.one

pull/744/head
Omar 2017-11-09 11:05:01 +01:00 committed by Alexandre D. Díaz
parent 0e9506b349
commit ce7001e35d
1 changed files with 14 additions and 13 deletions

View File

@ -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):