From 780cef98989696b9dfebdc61201f9789a9c648d8 Mon Sep 17 00:00:00 2001 From: Omar Date: Thu, 9 Nov 2017 11:05:01 +0100 Subject: [PATCH] [FIX] report_py3o: Removes api.one --- report_py3o/models/ir_actions_report_xml.py | 27 +++++++++++---------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/report_py3o/models/ir_actions_report_xml.py b/report_py3o/models/ir_actions_report_xml.py index 66d9a5fc..7298486e 100644 --- a/report_py3o/models/ir_actions_report_xml.py +++ b/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):