mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[IMP] print_zpl2 : quick move
This commit is contained in:
committed by
Lois Rilo
parent
6bb38387f7
commit
f920445f6a
@@ -70,7 +70,8 @@ class PrintingLabelZpl2(models.Model):
|
||||
record_id = fields.Integer(string="Record ID", default=1)
|
||||
extra = fields.Text(string="Extra", default="{}")
|
||||
printer_id = fields.Many2one(comodel_name="printing.printer", string="Printer")
|
||||
labelary_image = fields.Binary(string="Image from Labelary", readonly=True)
|
||||
labelary_image = fields.Binary(string='Image from Labelary',
|
||||
compute='_compute_labelary_image')
|
||||
labelary_dpmm = fields.Selection(
|
||||
selection=[
|
||||
("6dpmm", "6dpmm (152 pdi)"),
|
||||
@@ -407,16 +408,14 @@ class PrintingLabelZpl2(models.Model):
|
||||
if record:
|
||||
label.print_label(label.printer_id, record, **extra)
|
||||
|
||||
@api.onchange(
|
||||
"record_id",
|
||||
"labelary_dpmm",
|
||||
"labelary_width",
|
||||
"labelary_height",
|
||||
"component_ids",
|
||||
"origin_x",
|
||||
"origin_y",
|
||||
)
|
||||
def _on_change_labelary(self):
|
||||
@api.depends(
|
||||
'record_id', 'labelary_dpmm', 'labelary_width', 'labelary_height',
|
||||
'component_ids', 'origin_x', 'origin_y', 'test_labelary_mode')
|
||||
def _compute_labelary_image(self):
|
||||
for label in self:
|
||||
label.labelary_image = label._generate_labelary_image()
|
||||
|
||||
def _generate_labelary_image(self):
|
||||
self.ensure_one()
|
||||
if not (
|
||||
self.test_labelary_mode
|
||||
@@ -426,7 +425,7 @@ class PrintingLabelZpl2(models.Model):
|
||||
and self.labelary_dpmm
|
||||
and self.component_ids
|
||||
):
|
||||
return
|
||||
return False
|
||||
record = self._get_record()
|
||||
if record:
|
||||
# If case there an error (in the data field with the safe_eval
|
||||
@@ -454,15 +453,12 @@ class PrintingLabelZpl2(models.Model):
|
||||
new_im.paste(im, (1, 1))
|
||||
imgByteArr = io.BytesIO()
|
||||
new_im.save(imgByteArr, format="PNG")
|
||||
self.labelary_image = base64.b64encode(imgByteArr.getvalue())
|
||||
return base64.b64encode(imgByteArr.getvalue())
|
||||
else:
|
||||
return {
|
||||
"warning": {
|
||||
"title": _("Error with Labelary API."),
|
||||
"message": response.status_code,
|
||||
}
|
||||
}
|
||||
_logger.warning(
|
||||
_(
|
||||
"Error with Labelary API. %s") % response.status_code)
|
||||
|
||||
except Exception as e:
|
||||
self.labelary_image = False
|
||||
return {"warning": {"title": _("Some thing is wrong."), "message": e}}
|
||||
_logger.warning(_("Error with Labelary API. %s") % e)
|
||||
return False
|
||||
|
||||
@@ -232,3 +232,19 @@ class PrintingLabelZpl2Component(models.Model):
|
||||
help="This field holds a static image to print. "
|
||||
"If not set, the data field is evaluated.",
|
||||
)
|
||||
|
||||
def action_plus_origin_x(self):
|
||||
self.ensure_one()
|
||||
self.origin_x += 10
|
||||
|
||||
def action_minus_origin_x(self):
|
||||
self.ensure_one()
|
||||
self.origin_x -= 10
|
||||
|
||||
def action_plus_origin_y(self):
|
||||
self.ensure_one()
|
||||
self.origin_y += 10
|
||||
|
||||
def action_minus_origin_y(self):
|
||||
self.ensure_one()
|
||||
self.origin_y -= 10
|
||||
|
||||
@@ -67,10 +67,10 @@ class TestPrintingLabelZpl2(TransactionCase):
|
||||
def test_print_empty_label(self, cups):
|
||||
""" Check that printing an empty label works """
|
||||
label = self.new_label()
|
||||
file_name = 'test.zpl'
|
||||
file_name = "test.zpl"
|
||||
label.print_label(self.printer, self.printer)
|
||||
cups.Connection().printFile.assert_called_once_with(
|
||||
printer.system_name, file_name, file_name, options={}
|
||||
self.printer.system_name, file_name, file_name, options={}
|
||||
)
|
||||
|
||||
def test_empty_label_contents(self):
|
||||
@@ -1170,3 +1170,24 @@ class TestPrintingLabelZpl2(TransactionCase):
|
||||
self.assertEqual(
|
||||
contents, "^XA\n" "^PW480\n" "^CI28\n" "^LH10,10\n" "^JUR\n" "^XZ"
|
||||
)
|
||||
|
||||
def test_zpl2_component_quick_move(self):
|
||||
""" Check component quick move """
|
||||
label = self.new_label()
|
||||
component = self.new_component(
|
||||
{
|
||||
"label_id": label.id,
|
||||
"component_type": "zpl2_raw",
|
||||
"data": '""',
|
||||
"origin_x": 20,
|
||||
"origin_y": 30,
|
||||
}
|
||||
)
|
||||
component.action_plus_origin_x()
|
||||
self.assertEqual(30, component.origin_x)
|
||||
component.action_minus_origin_x()
|
||||
self.assertEqual(20, component.origin_x)
|
||||
component.action_plus_origin_y()
|
||||
self.assertEqual(40, component.origin_y)
|
||||
component.action_minus_origin_y()
|
||||
self.assertEqual(30, component.origin_y)
|
||||
|
||||
@@ -51,16 +51,15 @@ class TestWizardPrintRecordLabel(TransactionCase):
|
||||
self.label.test_print_mode = True
|
||||
self.label.printer_id = self.printer
|
||||
self.label.record_id = 10
|
||||
file_name = 'test.zpl'
|
||||
file_name = "test.zpl"
|
||||
self.label.print_test_label()
|
||||
cups.Connection().printFile.assert_called_once_with(
|
||||
self.printer.system_name, file_name, file_name, options={}
|
||||
self.printer.system_name, file_name, file_name, options={}
|
||||
)
|
||||
|
||||
def test_emulation_without_params(self):
|
||||
""" Check if not execute next if not in this mode """
|
||||
self.label.test_labelary_mode = False
|
||||
self.label._on_change_labelary()
|
||||
self.assertIs(self.label.labelary_image, False)
|
||||
|
||||
def test_emulation_with_bad_header(self):
|
||||
@@ -72,7 +71,6 @@ class TestWizardPrintRecordLabel(TransactionCase):
|
||||
self.env["printing.label.zpl2.component"].create(
|
||||
{"name": "ZPL II Label", "label_id": self.label.id, "data": '"Test"'}
|
||||
)
|
||||
self.label._on_change_labelary()
|
||||
self.assertFalse(self.label.labelary_image)
|
||||
|
||||
def test_emulation_with_bad_data_compute(self):
|
||||
@@ -84,7 +82,6 @@ class TestWizardPrintRecordLabel(TransactionCase):
|
||||
component = self.env["printing.label.zpl2.component"].create(
|
||||
{"name": "ZPL II Label", "label_id": self.label.id, "data": "wrong_data"}
|
||||
)
|
||||
self.label._on_change_labelary()
|
||||
component.unlink()
|
||||
self.assertIs(self.label.labelary_image, False)
|
||||
|
||||
@@ -97,5 +94,4 @@ class TestWizardPrintRecordLabel(TransactionCase):
|
||||
self.env["printing.label.zpl2.component"].create(
|
||||
{"name": "ZPL II Label", "label_id": self.label.id, "data": '"good_data"'}
|
||||
)
|
||||
self.label._on_change_labelary()
|
||||
self.assertTrue(self.label.labelary_image)
|
||||
|
||||
@@ -48,9 +48,9 @@ class TestWizardPrintRecordLabel(TransactionCase):
|
||||
self.assertEqual(wizard.printer_id, self.printer)
|
||||
self.assertEqual(wizard.label_id, self.label)
|
||||
wizard.print_label()
|
||||
file_name = 'test.zpl'
|
||||
file_name = "test.zpl"
|
||||
cups.Connection().printFile.assert_called_once_with(
|
||||
self.printer.system_name, file_name, file_name, options={}
|
||||
self.printer.system_name, file_name, file_name, options={}
|
||||
)
|
||||
|
||||
def test_wizard_multiple_printers_and_labels(self):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" ?>
|
||||
<!--
|
||||
Copyright 2016 SUBTENO-IT
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
@@ -8,8 +8,8 @@
|
||||
<field name="model">printing.label.zpl2</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="ZPL II Label">
|
||||
<field name="name"/>
|
||||
<field name="model_id"/>
|
||||
<field name="name" />
|
||||
<field name="model_id" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -18,7 +18,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="ZPL II Label">
|
||||
<header>
|
||||
<button name="import_zpl2" string="Import ZPL2" type="object"/>
|
||||
<button name="import_zpl2" string="Import ZPL2" type="object" />
|
||||
</header>
|
||||
<sheet>
|
||||
<widget
|
||||
@@ -29,117 +29,227 @@
|
||||
/>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<field name="active" invisible="1"/>
|
||||
<field name="action_window_id" invisible="1"/>
|
||||
<button name="create_action" string="Add in the 'Action' menu" type="object" attrs="{'invisible':[('action_window_id','!=',False)]}" icon="fa-plus-square" help="Display an option on related documents." class="oe_stat_button"/>
|
||||
<button name="unlink_action" string="Remove from the 'Action' menu" type="object" attrs="{'invisible':[('action_window_id','=',False)]}" icon="fa-minus-square" help="Remove the contextual action." class="oe_stat_button"/>
|
||||
<field name="action_window_id" invisible="1" />
|
||||
<button
|
||||
name="create_action"
|
||||
string="Add in the 'Action' menu"
|
||||
type="object"
|
||||
attrs="{'invisible':[('action_window_id','!=',False)]}"
|
||||
icon="fa-plus-square"
|
||||
help="Display an option on related documents."
|
||||
class="oe_stat_button"
|
||||
/>
|
||||
<button
|
||||
name="unlink_action"
|
||||
string="Remove from the 'Action' menu"
|
||||
type="object"
|
||||
attrs="{'invisible':[('action_window_id','=',False)]}"
|
||||
icon="fa-minus-square"
|
||||
help="Remove the contextual action."
|
||||
class="oe_stat_button"
|
||||
/>
|
||||
</div>
|
||||
<group col="4">
|
||||
<field name="name"/>
|
||||
<field name="model_id"/>
|
||||
<field name="description"/>
|
||||
<field name="width"/>
|
||||
<field name="origin_x"/>
|
||||
<field name="origin_y"/>
|
||||
<field name="data_type"/>
|
||||
<field name="restore_saved_config"/>
|
||||
<field name="name" />
|
||||
<field name="model_id" />
|
||||
<field name="description" />
|
||||
<field name="width" />
|
||||
<field name="origin_x" />
|
||||
<field name="origin_y" />
|
||||
<field name="data_type" />
|
||||
<field name="restore_saved_config" />
|
||||
</group>
|
||||
<group attrs="{'invisible':[('test_print_mode', '=', False)]}">
|
||||
<button name="print_test_label" string="Print Test" type="object" class="oe_highlight"/>
|
||||
<button
|
||||
name="print_test_label"
|
||||
string="Print Test"
|
||||
type="object"
|
||||
class="oe_highlight"
|
||||
/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Components">
|
||||
<field name="component_ids" nolabel="1" colspan="4">
|
||||
<tree string="Label Component">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="component_type"/>
|
||||
<field name="origin_x"/>
|
||||
<field name="origin_y"/>
|
||||
<field name="sequence" />
|
||||
<field name="name" />
|
||||
<field name="component_type" />
|
||||
<field name="origin_x" />
|
||||
<button
|
||||
name="action_minus_origin_x"
|
||||
type="object"
|
||||
string="-"
|
||||
icon="fa-minus-square"
|
||||
/>
|
||||
<button
|
||||
name="action_plus_origin_x"
|
||||
type="object"
|
||||
string="+"
|
||||
icon="fa-plus-square"
|
||||
/>
|
||||
<field name="origin_y" />
|
||||
<button
|
||||
name="action_minus_origin_y"
|
||||
type="object"
|
||||
string="-"
|
||||
icon="fa-minus-square"
|
||||
/>
|
||||
<button
|
||||
name="action_plus_origin_y"
|
||||
type="object"
|
||||
string="+"
|
||||
icon="fa-plus-square"
|
||||
/>
|
||||
</tree>
|
||||
<form string="Label Component">
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<field name="name" />
|
||||
<field name="sequence" />
|
||||
</group>
|
||||
<group>
|
||||
<field name="component_type"/>
|
||||
<field name="repeat" attrs="{'invisible': [('component_type', '=', 'zpl2_raw')]}"/>
|
||||
<field name="component_type" />
|
||||
<field
|
||||
name="repeat"
|
||||
attrs="{'invisible': [('component_type', '=', 'zpl2_raw')]}"
|
||||
/>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('component_type', '=', 'zpl2_raw')]}">
|
||||
<field name="origin_x"/>
|
||||
<field name="origin_y"/>
|
||||
<group
|
||||
attrs="{'invisible': [('component_type', '=', 'zpl2_raw')]}"
|
||||
>
|
||||
<field name="origin_x" />
|
||||
<field name="origin_y" />
|
||||
</group>
|
||||
<group>
|
||||
<field name="graphic_image" attrs="{'invisible': [('component_type', '!=', 'graphic')]}"/>
|
||||
<field name="sublabel_id" attrs="{'invisible': [('component_type', '!=', 'sublabel')]}"/>
|
||||
<field
|
||||
name="graphic_image"
|
||||
attrs="{'invisible': [('component_type', '!=', 'graphic')]}"
|
||||
/>
|
||||
<field
|
||||
name="sublabel_id"
|
||||
attrs="{'invisible': [('component_type', '!=', 'sublabel')]}"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
<group attrs="{'invisible': [('component_type', 'in', ('rectangle', 'diagonal', 'circle'))]}" string="Data">
|
||||
<field name="data" widget="ace" options="{'mode': 'python'}" nolabel="1"/>
|
||||
<group
|
||||
attrs="{'invisible': [('component_type', 'in', ('rectangle', 'diagonal', 'circle'))]}"
|
||||
string="Data"
|
||||
>
|
||||
<field
|
||||
name="data"
|
||||
widget="ace"
|
||||
options="{'mode': 'python'}"
|
||||
nolabel="1"
|
||||
/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Format" attrs="{'invisible': [('component_type', 'in', ('sublabel', 'qr_code', 'zpl2_raw'))]}">
|
||||
<page
|
||||
string="Format"
|
||||
attrs="{'invisible': [('component_type', 'in', ('sublabel', 'qr_code', 'zpl2_raw'))]}"
|
||||
>
|
||||
<group>
|
||||
<field name="height"/>
|
||||
<field name="only_product_barcode"/>
|
||||
<field name="width" attrs="{'invisible': [('component_type', 'not in', ('text', 'rectangle', 'diagonal', 'circle', 'graphic'))]}"/>
|
||||
<field name="reverse_print"/>
|
||||
<field name="orientation" attrs="{'invisible': [('component_type', 'in', ('rectangle', 'diagonal', 'circle'))]}"/>
|
||||
<field name="font" attrs="{'invisible': [('component_type', '!=', 'text')]}"/>
|
||||
<field name="in_block" attrs="{'invisible': [('component_type', '!=', 'text')]}"/>
|
||||
<field name="thickness" attrs="{'invisible': [('component_type', 'not in', ('rectangle', 'diagonal', 'circle'))]}"/>
|
||||
<field name="color" attrs="{'invisible': [('component_type', 'not in', ('rectangle', 'diagonal', 'circle'))]}"/>
|
||||
<field name="diagonal_orientation" attrs="{'invisible': [('component_type', '!=', 'diagonal')], 'required': [('component_type', '=', 'diagonal')]}"/>
|
||||
<field name="height" />
|
||||
<field name="only_product_barcode" />
|
||||
<field
|
||||
name="width"
|
||||
attrs="{'invisible': [('component_type', 'not in', ('text', 'rectangle', 'diagonal', 'circle', 'graphic'))]}"
|
||||
/>
|
||||
<field name="reverse_print" />
|
||||
<field
|
||||
name="orientation"
|
||||
attrs="{'invisible': [('component_type', 'in', ('rectangle', 'diagonal', 'circle'))]}"
|
||||
/>
|
||||
<field
|
||||
name="font"
|
||||
attrs="{'invisible': [('component_type', '!=', 'text')]}"
|
||||
/>
|
||||
<field
|
||||
name="in_block"
|
||||
attrs="{'invisible': [('component_type', '!=', 'text')]}"
|
||||
/>
|
||||
<field
|
||||
name="thickness"
|
||||
attrs="{'invisible': [('component_type', 'not in', ('rectangle', 'diagonal', 'circle'))]}"
|
||||
/>
|
||||
<field
|
||||
name="color"
|
||||
attrs="{'invisible': [('component_type', 'not in', ('rectangle', 'diagonal', 'circle'))]}"
|
||||
/>
|
||||
<field
|
||||
name="diagonal_orientation"
|
||||
attrs="{'invisible': [('component_type', '!=', 'diagonal')], 'required': [('component_type', '=', 'diagonal')]}"
|
||||
/>
|
||||
</group>
|
||||
</page>
|
||||
<!-- Barcode specific arguments -->
|
||||
<page string="Barcode Format" attrs="{'invisible': [('component_type', 'in', ('text', 'rectangle', 'diagonal', 'circle', 'sublabel', 'graphic', 'qr_code', 'zpl2_raw'))]}">
|
||||
<page
|
||||
string="Barcode Format"
|
||||
attrs="{'invisible': [('component_type', 'in', ('text', 'rectangle', 'diagonal', 'circle', 'sublabel', 'graphic', 'qr_code', 'zpl2_raw'))]}"
|
||||
>
|
||||
<group>
|
||||
<field name="check_digits"/>
|
||||
<field name="interpretation_line"/>
|
||||
<field name="interpretation_line_above"/>
|
||||
<field name="module_width"/>
|
||||
<field name="bar_width_ratio"/>
|
||||
<field name="security_level"/>
|
||||
<field name="columns_count"/>
|
||||
<field name="rows_count"/>
|
||||
<field name="truncate"/>
|
||||
<field name="check_digits" />
|
||||
<field name="interpretation_line" />
|
||||
<field
|
||||
name="interpretation_line_above"
|
||||
/>
|
||||
<field name="module_width" />
|
||||
<field name="bar_width_ratio" />
|
||||
<field name="security_level" />
|
||||
<field name="columns_count" />
|
||||
<field name="rows_count" />
|
||||
<field name="truncate" />
|
||||
</group>
|
||||
</page>
|
||||
<!-- 2D Barcode arguments -->
|
||||
<page string="2D Barcode Arguments" attrs="{'invisible': [('component_type', '!=', 'qr_code')]}">
|
||||
<page
|
||||
string="2D Barcode Arguments"
|
||||
attrs="{'invisible': [('component_type', '!=', 'qr_code')]}"
|
||||
>
|
||||
<group>
|
||||
<field name="model"/>
|
||||
<field name="magnification_factor"/>
|
||||
<field name="error_correction"/>
|
||||
<field name="mask_value"/>
|
||||
<field name="model" />
|
||||
<field name="magnification_factor" />
|
||||
<field name="error_correction" />
|
||||
<field name="mask_value" />
|
||||
</group>
|
||||
</page>
|
||||
<!-- Text block specific arguments -->
|
||||
<page string="Text Block Format" attrs="{'invisible': ['|', ('component_type', '!=', 'text'), ('in_block', '=', False)]}">
|
||||
<page
|
||||
string="Text Block Format"
|
||||
attrs="{'invisible': ['|', ('component_type', '!=', 'text'), ('in_block', '=', False)]}"
|
||||
>
|
||||
<group>
|
||||
<field name="block_width"/>
|
||||
<field name="block_lines"/>
|
||||
<field name="block_spaces"/>
|
||||
<field name="block_justify"/>
|
||||
<field name="block_left_margin"/>
|
||||
<field name="block_width" />
|
||||
<field name="block_lines" />
|
||||
<field name="block_spaces" />
|
||||
<field name="block_justify" />
|
||||
<field name="block_left_margin" />
|
||||
</group>
|
||||
</page>
|
||||
<!-- Repeat specific arguments -->
|
||||
<page string="Repeat" attrs="{'invisible': [('repeat', '=', False)]}">
|
||||
<page
|
||||
string="Repeat"
|
||||
attrs="{'invisible': [('repeat', '=', False)]}"
|
||||
>
|
||||
<group>
|
||||
<field name="repeat_offset"/>
|
||||
<field name="repeat_count"/>
|
||||
<field name="repeat_offset_x"/>
|
||||
<field name="repeat_offset_y"/>
|
||||
<field name="repeat_offset" />
|
||||
<field name="repeat_count" />
|
||||
<field name="repeat_offset_x" />
|
||||
<field name="repeat_offset_y" />
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
<group string="Emulation" attrs="{'invisible':[('test_labelary_mode', '=', False)]}">
|
||||
<field name="labelary_image" widget="image" nolabel="1" force_save="1"/>
|
||||
<group
|
||||
string="Emulation"
|
||||
attrs="{'invisible':[('test_labelary_mode', '=', False)]}"
|
||||
>
|
||||
<field
|
||||
name="labelary_image"
|
||||
widget="image"
|
||||
nolabel="1"
|
||||
force_save="1"
|
||||
/>
|
||||
<p class="oe_grey" colspan="4">
|
||||
Note : It is an emulation from http://labelary.com/, the result on printer can be different.
|
||||
</p>
|
||||
@@ -148,21 +258,42 @@
|
||||
<page string="Test Mode">
|
||||
<group>
|
||||
<group>
|
||||
<field name="test_print_mode"/>
|
||||
<field name="test_labelary_mode"/>
|
||||
<field name="test_print_mode" />
|
||||
<field name="test_labelary_mode" />
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group>
|
||||
<field name="record_id" attrs="{'invisible':[('test_print_mode', '=', False), ('test_labelary_mode', '=', False)], 'required':['|', ('test_print_mode', '=', True), ('test_labelary_mode', '=', True)]}"/>
|
||||
<field name="printer_id" attrs="{'invisible':[('test_print_mode', '=', False)], 'required':[('test_print_mode', '=', True)]}"/>
|
||||
<field name="labelary_dpmm" attrs="{'invisible':[('test_labelary_mode', '=', False)], 'required':[('test_labelary_mode', '=', True)]}"/>
|
||||
<field name="labelary_width" attrs="{'invisible':[('test_labelary_mode', '=', False)], 'required':[('test_labelary_mode', '=', True)]}"/>
|
||||
<field name="labelary_height" attrs="{'invisible':[('test_labelary_mode', '=', False)], 'required':[('test_labelary_mode', '=', True)]}"/>
|
||||
<field
|
||||
name="record_id"
|
||||
attrs="{'invisible':[('test_print_mode', '=', False), ('test_labelary_mode', '=', False)], 'required':['|', ('test_print_mode', '=', True), ('test_labelary_mode', '=', True)]}"
|
||||
/>
|
||||
<field
|
||||
name="printer_id"
|
||||
attrs="{'invisible':[('test_print_mode', '=', False)], 'required':[('test_print_mode', '=', True)]}"
|
||||
/>
|
||||
<field
|
||||
name="labelary_dpmm"
|
||||
attrs="{'invisible':[('test_labelary_mode', '=', False)], 'required':[('test_labelary_mode', '=', True)]}"
|
||||
/>
|
||||
<field
|
||||
name="labelary_width"
|
||||
attrs="{'invisible':[('test_labelary_mode', '=', False)], 'required':[('test_labelary_mode', '=', True)]}"
|
||||
/>
|
||||
<field
|
||||
name="labelary_height"
|
||||
attrs="{'invisible':[('test_labelary_mode', '=', False)], 'required':[('test_labelary_mode', '=', True)]}"
|
||||
/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Extra">
|
||||
<field name="extra" nolabel="1" widget="ace" options="{'mode': 'python'}" attrs="{'invisible':[('test_print_mode', '=', False), ('test_labelary_mode', '=', False)]}"/>
|
||||
<field
|
||||
name="extra"
|
||||
nolabel="1"
|
||||
widget="ace"
|
||||
options="{'mode': 'python'}"
|
||||
attrs="{'invisible':[('test_print_mode', '=', False), ('test_labelary_mode', '=', False)]}"
|
||||
/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -174,9 +305,13 @@
|
||||
<field name="model">printing.label.zpl2</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="ZPL II Label">
|
||||
<field name="name"/>
|
||||
<field name="model_id"/>
|
||||
<filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
|
||||
<field name="name" />
|
||||
<field name="model_id" />
|
||||
<filter
|
||||
string="Archived"
|
||||
name="inactive"
|
||||
domain="[('active','=',False)]"
|
||||
/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -185,21 +320,32 @@
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">printing.label.zpl2</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="view_printing_label_zpl2_search"/>
|
||||
<field name="search_view_id" ref="view_printing_label_zpl2_search" />
|
||||
<field name="domain">[]</field>
|
||||
<field name="context">{}</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="act_open_printing_label_zpl2_view_form">
|
||||
<field name="act_window_id" ref="act_open_printing_label_zpl2_view"/>
|
||||
<field name="sequence" eval="20"/>
|
||||
<record
|
||||
model="ir.actions.act_window.view"
|
||||
id="act_open_printing_label_zpl2_view_form"
|
||||
>
|
||||
<field name="act_window_id" ref="act_open_printing_label_zpl2_view" />
|
||||
<field name="sequence" eval="20" />
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_printing_label_zpl2_form"/>
|
||||
<field name="view_id" ref="view_printing_label_zpl2_form" />
|
||||
</record>
|
||||
<record model="ir.actions.act_window.view" id="act_open_printing_label_zpl2_view_tree">
|
||||
<field name="act_window_id" ref="act_open_printing_label_zpl2_view"/>
|
||||
<field name="sequence" eval="10"/>
|
||||
<record
|
||||
model="ir.actions.act_window.view"
|
||||
id="act_open_printing_label_zpl2_view_tree"
|
||||
>
|
||||
<field name="act_window_id" ref="act_open_printing_label_zpl2_view" />
|
||||
<field name="sequence" eval="10" />
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="view_printing_label_zpl2_tree"/>
|
||||
<field name="view_id" ref="view_printing_label_zpl2_tree" />
|
||||
</record>
|
||||
<menuitem id="menu_printing_label_zpl2" parent="base_report_to_printer.printing_menu" sequence="20" action="act_open_printing_label_zpl2_view"/>
|
||||
<menuitem
|
||||
id="menu_printing_label_zpl2"
|
||||
parent="base_report_to_printer.printing_menu"
|
||||
sequence="20"
|
||||
action="act_open_printing_label_zpl2_view"
|
||||
/>
|
||||
</odoo>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" ?>
|
||||
<!--
|
||||
Copyright 2016 SYLEAM
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
@@ -10,12 +10,17 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Print Label">
|
||||
<group>
|
||||
<field name="printer_id"/>
|
||||
<field name="label_id"/>
|
||||
<field name="printer_id" />
|
||||
<field name="label_id" />
|
||||
</group>
|
||||
<footer>
|
||||
<button type="special" special="cancel" string="Cancel"/>
|
||||
<button string="Print label" type="object" name="print_label" class="oe_highlight"/>
|
||||
<button type="special" special="cancel" string="Cancel" />
|
||||
<button
|
||||
string="Print label"
|
||||
type="object"
|
||||
name="print_label"
|
||||
class="oe_highlight"
|
||||
/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" ?>
|
||||
<odoo>
|
||||
<record id="view_wizard_import_zpl2_form" model="ir.ui.view">
|
||||
<field name="name">wizard.import.zpl2.form</field>
|
||||
@@ -7,16 +7,21 @@
|
||||
<form string="Print Label">
|
||||
<group>
|
||||
<group>
|
||||
<field name="label_id"/>
|
||||
<field name="delete_component"/>
|
||||
<field name="label_id" />
|
||||
<field name="delete_component" />
|
||||
</group>
|
||||
</group>
|
||||
<group string="ZPL2">
|
||||
<field name="data" widget="ace" nolabel="1"/>
|
||||
<field name="data" widget="ace" nolabel="1" />
|
||||
</group>
|
||||
<footer>
|
||||
<button string="Cancel" class="btn-default" special="cancel"/>
|
||||
<button string="Import" type="object" name="import_zpl2" class="btn-primary"/>
|
||||
<button string="Cancel" class="btn-default" special="cancel" />
|
||||
<button
|
||||
string="Import"
|
||||
type="object"
|
||||
name="import_zpl2"
|
||||
class="btn-primary"
|
||||
/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user