[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
committed by John Herholz
parent 3a22073a87
commit 6caed6ace0
4 changed files with 23 additions and 27 deletions

View File

@@ -7,7 +7,7 @@
{ {
"name": "Report to printer", "name": "Report to printer",
"version": "14.0.2.0.0", "version": "15.0.1.0.0",
"category": "Generic Modules/Base", "category": "Generic Modules/Base",
"author": "Agile Business Group & Domsense, Pegueroles SCP, NaN," "author": "Agile Business Group & Domsense, Pegueroles SCP, NaN,"
" LasLabs, Camptocamp, Odoo Community Association (OCA)," " LasLabs, Camptocamp, Odoo Community Association (OCA),"
@@ -18,7 +18,6 @@
"data": [ "data": [
"data/printing_data.xml", "data/printing_data.xml",
"security/security.xml", "security/security.xml",
"views/assets.xml",
"views/printing_printer.xml", "views/printing_printer.xml",
"views/printing_server.xml", "views/printing_server.xml",
"views/printing_job.xml", "views/printing_job.xml",
@@ -27,6 +26,11 @@
"views/ir_actions_report.xml", "views/ir_actions_report.xml",
"wizards/printing_printer_update_wizard_view.xml", "wizards/printing_printer_update_wizard_view.xml",
], ],
"assets": {
"web.assets_backend": [
"/base_report_to_printer/static/src/js/qweb_action_manager.js",
],
},
"installable": True, "installable": True,
"application": False, "application": False,
"external_dependencies": {"python": ["pycups"]}, "external_dependencies": {"python": ["pycups"]},

View File

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

View File

@@ -27,7 +27,10 @@ class TestReport(common.HttpCase):
</t>""", </t>""",
} }
) )
self.report_imd = self.env["ir.model.data"].create( self.report_imd = (
self.env["ir.model.data"]
.sudo()
.create(
{ {
"name": "test", "name": "test",
"module": "base_report_to_printer", "module": "base_report_to_printer",
@@ -35,6 +38,7 @@ class TestReport(common.HttpCase):
"res_id": self.report_view.id, "res_id": self.report_view.id,
} }
) )
)
self.report = self.Model.create( self.report = self.Model.create(
{ {
"name": "Test", "name": "Test",

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template
id="assets_backend"
name="base_report_to_printer assets"
inherit_id="web.assets_backend"
>
<xpath expr="." position="inside">
<script
type="text/javascript"
src="/base_report_to_printer/static/src/js/qweb_action_manager.js"
/>
</xpath>
</template>
</odoo>