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()
|
self.ensure_one()
|
||||||
connection = False
|
connection = False
|
||||||
try:
|
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)
|
connection = cups.Connection(host=self.address, port=self.port)
|
||||||
except Exception:
|
except Exception:
|
||||||
message = _(
|
message = _(
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<group name="name">
|
<group name="name">
|
||||||
<field name="system_name" />
|
<field name="system_name" />
|
||||||
|
<field name="server_id" />
|
||||||
</group>
|
</group>
|
||||||
<group col="4" colspan="4" name="default">
|
<group col="4" colspan="4" name="default">
|
||||||
<field name="default" />
|
<field name="default" />
|
||||||
@@ -100,6 +101,7 @@
|
|||||||
<field name="default" />
|
<field name="default" />
|
||||||
<field name="name" />
|
<field name="name" />
|
||||||
<field name="system_name" />
|
<field name="system_name" />
|
||||||
|
<field name="server_id" />
|
||||||
<field name="status" />
|
<field name="status" />
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user