mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
Reformatted after template update
This commit is contained in:
@@ -35,12 +35,12 @@ class IrActionsReport(models.Model):
|
||||
|
||||
@api.onchange("printing_printer_id")
|
||||
def onchange_printing_printer_id(self):
|
||||
""" Reset the tray when the printer is changed """
|
||||
"""Reset the tray when the printer is changed"""
|
||||
self.printer_tray_id = False
|
||||
|
||||
@api.model
|
||||
def print_action_for_report_name(self, report_name):
|
||||
""" Returns if the action is a direct print or pdf
|
||||
"""Returns if the action is a direct print or pdf
|
||||
|
||||
Called from js
|
||||
"""
|
||||
@@ -99,7 +99,7 @@ class IrActionsReport(models.Model):
|
||||
return result
|
||||
|
||||
def print_document(self, record_ids, data=None):
|
||||
""" Print a document, do not return the document file """
|
||||
"""Print a document, do not return the document file"""
|
||||
document, doc_format = self.with_context(
|
||||
must_skip_send_to_printer=True
|
||||
).render_qweb_pdf(record_ids, data=data)
|
||||
@@ -143,7 +143,7 @@ class IrActionsReport(models.Model):
|
||||
return res
|
||||
|
||||
def render_qweb_pdf(self, res_ids=None, data=None):
|
||||
""" Generate a PDF and returns it.
|
||||
"""Generate a PDF and returns it.
|
||||
|
||||
If the action configured on the report is server, it prints the
|
||||
generated document as well.
|
||||
|
||||
@@ -132,7 +132,7 @@ class PrintingPrinter(models.Model):
|
||||
return vals
|
||||
|
||||
def print_document(self, report, content, **print_opts):
|
||||
""" Print a file
|
||||
"""Print a file
|
||||
Format could be pdf, qweb-pdf, raw, ...
|
||||
"""
|
||||
self.ensure_one()
|
||||
@@ -173,7 +173,7 @@ class PrintingPrinter(models.Model):
|
||||
return options
|
||||
|
||||
def print_file(self, file_name, report=None, **print_opts):
|
||||
""" Print a file """
|
||||
"""Print a file"""
|
||||
self.ensure_one()
|
||||
title = print_opts.pop("title", file_name)
|
||||
connection = self.server_id._open_connection(raise_on_error=True)
|
||||
|
||||
@@ -35,7 +35,7 @@ class PrintingReportXmlAction(models.Model):
|
||||
|
||||
@api.onchange("printer_id")
|
||||
def onchange_printer_id(self):
|
||||
""" Reset the tray when the printer is changed """
|
||||
"""Reset the tray when the printer is changed"""
|
||||
self.printer_tray_id = False
|
||||
|
||||
def behaviour(self):
|
||||
|
||||
@@ -38,5 +38,5 @@ class ResUsers(models.Model):
|
||||
|
||||
@api.onchange("printing_printer_id")
|
||||
def onchange_printing_printer_id(self):
|
||||
""" Reset the tray when the printer is changed """
|
||||
"""Reset the tray when the printer is changed"""
|
||||
self.printer_tray_id = False
|
||||
|
||||
Reference in New Issue
Block a user