[WIP] Migrate base_report_to_printer to V12

This commit is contained in:
Graeme Gellatly
2019-01-31 12:40:08 +13:00
committed by David Montull
parent dbb332b204
commit 2dfca7adeb
63 changed files with 4131 additions and 3513 deletions

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

View File

@@ -30,6 +30,7 @@ class TestPrintingPrinter(TransactionCase):
'location': 'Location',
'uri': 'URI',
}
self.report = self.env['ir.actions.report'].search([], limit=1)
def new_record(self):
return self.Model.create(self.printer_vals)
@@ -66,7 +67,6 @@ class TestPrintingPrinter(TransactionCase):
def test_print_options(self):
""" It should generate the right options dictionnary """
'copies': '2',
# TODO: None here used as report - tests here should be merged
# with tests in test_printing_printer_tray from when modules merged
report = self.env['ir.actions.report'].search([], limit=1)

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
@@ -165,7 +164,6 @@ class TestPrintingPrinter(TransactionCase):
self, os_unlink, cups):
"""
When a ENOENT error is encountered, the file has already been unlinked
This is not an issue, as we were trying to delete the file.
The update can continue.
"""

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
@@ -26,6 +25,7 @@ class TestPrintingPrinterWizard(TransactionCase):
'printer-make-and-model': 'Make and Model',
'printer-location': "location",
'device-uri': 'URI',
'printer-uri-supported': 'uri'
}
def _record_vals(self, sys_name='sys_name'):
@@ -52,6 +52,7 @@ class TestPrintingPrinterWizard(TransactionCase):
cups.Connection().getPrinters.return_value = {
'sys_name': self.printer_vals,
}
cups.Connection().getPPD3.return_value = (200, 0, '')
self.Model.action_ok()
cups.Connection().getPrinters.assert_called_once_with()
@@ -68,6 +69,7 @@ class TestPrintingPrinterWizard(TransactionCase):
cups.Connection().getPrinters.return_value = {
'sys_name': self.printer_vals,
}
cups.Connection().getPPD3.return_value = (200, 0, '')
self.Model.action_ok()
rec_id = self.env['printing.printer'].search([
('system_name', '=', 'sys_name')
@@ -89,6 +91,7 @@ class TestPrintingPrinterWizard(TransactionCase):
cups.Connection().getPrinters.return_value = {
'sys_name': self.printer_vals,
}
cups.Connection().getPPD3.return_value = (200, 0, '')
self.env['printing.printer'].create(
self._record_vals()
)

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 SYLEAM
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
@@ -47,12 +46,14 @@ class TestPrintingReportXmlAction(TransactionCase):
self.assertEqual(xml_action.behaviour(), {
'action': xml_action.action,
'printer': xml_action.printer_id,
'tray': False,
})
xml_action = self.new_record({'printer_id': self.new_printer().id})
self.assertEqual(xml_action.behaviour(), {
'action': xml_action.action,
'printer': xml_action.printer_id,
'tray': False,
})
self.assertEqual(self.Model.behaviour(), {})

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# Copyright 2017 Tecnativa - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).