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 13.0
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from odoo import models, fields, api, exceptions, _
|
||||
from odoo import models, fields, exceptions, _
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -32,13 +32,12 @@ class PrintingServer(models.Model):
|
||||
string='Printers List',
|
||||
help='List of printers available on this server.')
|
||||
|
||||
@api.multi
|
||||
def _open_connection(self, raise_on_error=False):
|
||||
self.ensure_one()
|
||||
connection = False
|
||||
try:
|
||||
connection = cups.Connection(host=self.address, port=self.port)
|
||||
except:
|
||||
except Exception:
|
||||
message = _("Failed to connect to the CUPS server on %s:%s. "
|
||||
"Check that the CUPS server is running and that "
|
||||
"you can reach it from the Odoo server.") % (
|
||||
@@ -49,11 +48,9 @@ class PrintingServer(models.Model):
|
||||
|
||||
return connection
|
||||
|
||||
@api.multi
|
||||
def action_update_printers(self):
|
||||
return self.update_printers()
|
||||
|
||||
@api.multi
|
||||
def update_printers(self, domain=None, raise_on_error=False):
|
||||
if domain is None:
|
||||
domain = []
|
||||
@@ -106,7 +103,6 @@ class PrintingServer(models.Model):
|
||||
self = self.search([])
|
||||
return self.update_jobs()
|
||||
|
||||
@api.multi
|
||||
def update_jobs(self, which='all', first_job_id=-1):
|
||||
job_obj = self.env['printing.job']
|
||||
printer_obj = self.env['printing.printer']
|
||||
|
||||
Reference in New Issue
Block a user