mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[IMP] base_report_to_printer: Add printer option to launch reports in new thread
This commit is contained in:
@@ -12,7 +12,7 @@ import logging
|
||||
import os
|
||||
from tempfile import mkstemp
|
||||
|
||||
from odoo import fields, models
|
||||
from odoo import api, fields, models
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -67,6 +67,14 @@ class PrintingPrinter(models.Model):
|
||||
tray_ids = fields.One2many(
|
||||
comodel_name="printing.tray", inverse_name="printer_id", string="Paper Sources"
|
||||
)
|
||||
multi_thread = fields.Boolean(
|
||||
compute="_compute_multi_thread", readonly=False, store=True
|
||||
)
|
||||
|
||||
@api.depends("server_id.multi_thread")
|
||||
def _compute_multi_thread(self):
|
||||
for printer in self:
|
||||
printer.multi_thread = printer.server_id.multi_thread
|
||||
|
||||
def _prepare_update_from_cups(self, cups_connection, cups_printer):
|
||||
mapping = {3: "available", 4: "printing", 5: "error"}
|
||||
|
||||
Reference in New Issue
Block a user