mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[14.0][IMP] base_report_to_printer: Add Text render document to printer
This commit is contained in:
@@ -160,3 +160,22 @@ class IrActionsReport(models.Model):
|
||||
)
|
||||
|
||||
return document, doc_format
|
||||
|
||||
def _render_qweb_text(self, docids, data=None):
|
||||
"""Generate a TEXT file and returns it.
|
||||
|
||||
If the action configured on the report is server, it prints the
|
||||
generated document as well.
|
||||
"""
|
||||
document, doc_format = super()._render_qweb_text(docids=docids, data=data)
|
||||
|
||||
behaviour = self.behaviour()
|
||||
printer = behaviour.pop("printer", None)
|
||||
can_print_report = self._can_print_report(behaviour, printer, document)
|
||||
|
||||
if can_print_report:
|
||||
printer.print_document(
|
||||
self, document, doc_format=self.report_type, **behaviour
|
||||
)
|
||||
|
||||
return document, doc_format
|
||||
|
||||
Reference in New Issue
Block a user