mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[MIG] base_report_to_printer: Migration to v14
This commit is contained in:
@@ -135,9 +135,7 @@ class IrActionsReport(models.Model):
|
||||
If the action configured on the report is server, it prints the
|
||||
generated document as well.
|
||||
"""
|
||||
document, doc_format = super(IrActionsReport, self).render_qweb_pdf(
|
||||
res_ids=res_ids, data=data
|
||||
)
|
||||
document, doc_format = super().render_qweb_pdf(res_ids=res_ids, data=data)
|
||||
|
||||
behaviour = self.behaviour()
|
||||
printer = behaviour.pop("printer", None)
|
||||
|
||||
@@ -169,8 +169,8 @@ class PrintingPrinter(models.Model):
|
||||
options = self.print_options(report=report, **print_opts)
|
||||
|
||||
_logger.debug(
|
||||
"Sending job to CUPS printer %s on %s"
|
||||
% (self.system_name, self.server_id.address)
|
||||
"Sending job to CUPS printer %s on %s with options %s"
|
||||
% (self.system_name, self.server_id.address, options)
|
||||
)
|
||||
connection.printFile(self.system_name, file_name, file_name, options=options)
|
||||
_logger.info(
|
||||
|
||||
@@ -61,7 +61,7 @@ class PrintingServer(models.Model):
|
||||
servers = self.search(domain)
|
||||
|
||||
res = True
|
||||
for server in servers.with_context(active_test=False):
|
||||
for server in servers:
|
||||
connection = server._open_connection(raise_on_error=raise_on_error)
|
||||
if not connection:
|
||||
server.printer_ids.write({"status": "server-error"})
|
||||
@@ -71,7 +71,8 @@ class PrintingServer(models.Model):
|
||||
# Update Printers
|
||||
printers = connection.getPrinters()
|
||||
existing_printers = {
|
||||
printer.system_name: printer for printer in server.printer_ids
|
||||
printer.system_name: printer
|
||||
for printer in server.with_context(active_test=False).printer_ids
|
||||
}
|
||||
updated_printers = []
|
||||
for name, printer_info in printers.items():
|
||||
|
||||
Reference in New Issue
Block a user