mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[IMP] Add a button to generate an action to launch the print wizard
This commit is contained in:
committed by
Lois Rilo
parent
041ee4cd82
commit
1024ddfa42
38
printer_zpl2/tests/test_generate_action.py
Normal file
38
printer_zpl2/tests/test_generate_action.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
model = 'odoo.addons.base_report_to_printer.models.printing_server'
|
||||
|
||||
|
||||
class TestWizardPrintRecordLabel(TransactionCase):
|
||||
def setUp(self):
|
||||
super(TestWizardPrintRecordLabel, self).setUp()
|
||||
self.Model = self.env['wizard.print.record.label']
|
||||
self.server = self.env['printing.server'].create({})
|
||||
self.printer = self.env['printing.printer'].create({
|
||||
'name': 'Printer',
|
||||
'server_id': self.server.id,
|
||||
'system_name': 'Sys Name',
|
||||
'default': True,
|
||||
'status': 'unknown',
|
||||
'status_message': 'Msg',
|
||||
'model': 'res.users',
|
||||
'location': 'Location',
|
||||
'uri': 'URI',
|
||||
})
|
||||
self.label = self.env['printing.label.zpl2'].create({
|
||||
'name': 'ZPL II Label',
|
||||
'model_id': self.env.ref(
|
||||
'base_report_to_printer.model_printing_printer').id,
|
||||
})
|
||||
|
||||
def test_create_action(self):
|
||||
""" Check the creation of action """
|
||||
self.label.create_action()
|
||||
self.assertTrue(self.label.action_window_id)
|
||||
|
||||
def test_unlink_action(self):
|
||||
""" Check the unlink of action """
|
||||
self.label.unlink_action()
|
||||
self.assertFalse(self.label.action_window_id)
|
||||
Reference in New Issue
Block a user