From d98539e6ac0be70ec8daff3eef86749b91ba27d4 Mon Sep 17 00:00:00 2001 From: Nicolas Bessi Date: Fri, 6 Feb 2015 13:05:57 +0100 Subject: [PATCH] Improve bloated condition test --- base_report_to_printer/report.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/base_report_to_printer/report.py b/base_report_to_printer/report.py index 6815f2b..a33e3cb 100644 --- a/base_report_to_printer/report.py +++ b/base_report_to_printer/report.py @@ -50,9 +50,7 @@ class Report(models.Model): If you want to prevent `get_pdf` to send report you can set the `must_skip_send_to_printer` key to True in the context """ - if context is None: - context = self.pool['res.users'].context_get(cr, uid) - if context.get('must_skip_send_to_printer'): + if context is not None and context.get('must_skip_send_to_printer'): return False if behaviour['action'] == 'server' and printer and document: return True