mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[FIX] base_report_to_printer: error printing in external network.
Error code: 1030, 'The printer or class does not exist.')". An explicit call to `setServer` and `setPort` fixed the issue. (see https://github.com/OpenPrinting/pycups/issues/30) Also, added serve_id to printer views
This commit is contained in:
@@ -36,6 +36,13 @@ class PrintingServer(models.Model):
|
||||
self.ensure_one()
|
||||
connection = False
|
||||
try:
|
||||
# Sometimes connecting to printer servers outside of the local network
|
||||
# can result in a weird error "cups.IPPError: (1030, 'The printer
|
||||
# or class does not exist.')".
|
||||
# An explicit call to `setServer` and `setPort` fixed the issue.
|
||||
# (see https://github.com/OpenPrinting/pycups/issues/30)
|
||||
cups.setServer(self.address)
|
||||
cups.setPort(self.port)
|
||||
connection = cups.Connection(host=self.address, port=self.port)
|
||||
except Exception:
|
||||
message = _(
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
</div>
|
||||
<group name="name">
|
||||
<field name="system_name" />
|
||||
<field name="server_id" />
|
||||
</group>
|
||||
<group col="4" colspan="4" name="default">
|
||||
<field name="default" />
|
||||
@@ -100,6 +101,7 @@
|
||||
<field name="default" />
|
||||
<field name="name" />
|
||||
<field name="system_name" />
|
||||
<field name="server_id" />
|
||||
<field name="status" />
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user