[MIG] printer_zpl2: Migration to 12.0

This commit is contained in:
Florent de Labarre
2019-03-20 14:24:37 +01:00
committed by Lois Rilo
parent a862116674
commit 3ef9604675
11 changed files with 52 additions and 24 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2018 Florent Mirieu (<https://github.com/fmdl>)
# Copyright (C) 2018 Florent de Labarre (<https://github.com/fmdl>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase

View File

@@ -1116,3 +1116,22 @@ class TestPrintingLabelZpl2(TransactionCase):
'^FO50,50^GB100,100,100^FS\n'
'^JUR\n'
'^XZ')
def test_zpl2_component_not_show(self):
""" Check to don't show no things """
label = self.new_label()
data = 'component_not_show'
self.new_component({
'label_id': label.id,
'component_type': 'zpl2_raw',
'data': '"' + data + '"',
})
contents = label._generate_zpl2_data(self.printer).decode("utf-8")
self.assertEqual(
contents,
'^XA\n'
'^PW480\n'
'^CI28\n'
'^LH10,10\n'
'^JUR\n'
'^XZ')

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2018 Florent Mirieu (<https://github.com/fmdl>)
# Copyright (C) 2018 Florent de Labarre (<https://github.com/fmdl>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import mock

View File

@@ -1,4 +1,4 @@
# Copyright (C) 2018 Florent Mirieu (<https://github.com/fmdl>)
# Copyright (C) 2018 Florent de Labarre (<https://github.com/fmdl>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase