[15.0][MIG] base_report_to_printer: Migration to 15.0

This commit is contained in:
David Montull
2022-03-04 13:52:14 +01:00
parent 50932588ad
commit 9384082e96
4 changed files with 23 additions and 27 deletions

View File

@@ -71,13 +71,16 @@ class PrintingServer(models.Model):
connection = cups.Connection(host=self.address, port=self.port)
except Exception:
message = _(
"Failed to connect to the CUPS server on %s:%s. "
"Failed to connect to the CUPS server on %(address)s:%(port)s. "
"Check that the CUPS server is running and that "
"you can reach it from the Odoo server."
) % (self.address, self.port)
) % {
"address": self.address,
"port": self.port,
}
_logger.warning(message)
if raise_on_error:
raise exceptions.UserError(message)
raise exceptions.UserError(message) from Exception
return connection