[FIX] Check constrains only if report_type == 'py3o'

pull/744/head
Laurent Mignon (ACSONE) 2016-10-12 16:24:27 +02:00 committed by Alexandre D. Díaz
parent 50037e8cbb
commit 5dd8ac4063
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,8 @@ class IrActionsReportXml(models.Model):
@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):