changeset efc2714b8b27 in trytond:5.0
details: https://hg.tryton.org/trytond?cmd=changeset;node=efc2714b8b27
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 dbc514429db6 -r efc2714b8b27 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
@@ -363,7 +364,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):