changeset d7772acbef89 in trytond:5.4
details: https://hg.tryton.org/trytond?cmd=changeset;node=d7772acbef89
description:
        Properly test if report type in get_email

        We must test if it is a subclass and not an instance of Report.

        issue9196
        review307221002
        (grafted from 0f87869670a10d69c75c58b089f5be8ed3bbf211)
diffstat:

 trytond/report/report.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r ce0d3b682169 -r d7772acbef89 trytond/report/report.py
--- a/trytond/report/report.py  Fri Apr 10 18:25:03 2020 +0200
+++ b/trytond/report/report.py  Fri Apr 10 18:26:35 2020 +0200
@@ -2,6 +2,7 @@
 # this repository contains the full copyright notices and license terms.
 import datetime
 import os
+import inspect
 import logging
 import subprocess
 import tempfile
@@ -420,7 +421,7 @@
     pool = Pool()
     ActionReport = pool.get('ir.action.report')
     report_id = None
-    if isinstance(report, Report):
+    if inspect.isclass(report) and issubclass(report, Report):
         Report_ = report
     else:
         if isinstance(report, ActionReport):

Reply via email to