mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
Improve bloated condition test
This commit is contained in:
committed by
Guewen Baconnier
parent
68454324c6
commit
9e3b34b60c
@@ -50,9 +50,7 @@ class Report(models.Model):
|
|||||||
If you want to prevent `get_pdf` to send report you can set
|
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
|
the `must_skip_send_to_printer` key to True in the context
|
||||||
"""
|
"""
|
||||||
if context is None:
|
if context is not None and context.get('must_skip_send_to_printer'):
|
||||||
context = self.pool['res.users'].context_get(cr, uid)
|
|
||||||
if context.get('must_skip_send_to_printer'):
|
|
||||||
return False
|
return False
|
||||||
if behaviour['action'] == 'server' and printer and document:
|
if behaviour['action'] == 'server' and printer and document:
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user