Repository
OCA/report-print-send · module folder · Try on Runboat
Module version
1.0.2
Category
Printer
Folder size
1.02 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/report-print-send
Last tracking update
2026-08-07 08:42:48
Authors
Odoo Community Association (OCA), Apertoso NV, SUBTENO-IT, FLorent de Labarre
Maintainers
Odoo Community Association (OCA), Apertoso NV, SUBTENO-IT, FLorent de Labarre
Committers
Carlos Lopez, Vincent Van Rossem, Weblate, OCA-git-bot, oca-ci, arantxa-s73
Odoo dependencies
OCA/report-print-send:
odoo/odoo:
- web
Python dependencies
pycups
System dependencies
None
Required by
None
Description
This module extends the **Report to printer** (`base_report_to_printer`)
module to add a ZPL II label printing feature.

This module is meant to be used as a base for module development, and
does not provide a GUI on its own. See below for more details.

Code Analysis

Views touched (5)
XML IDNameModelTypeStatus
view_printing_label_zpl2_form printing.label.zpl2 form New
view_printing_label_zpl2_list printing.label.zpl2 list New
view_printing_label_zpl2_search printing.label.zpl2 search New
view_wizard_import_zpl2_form wizard.import.zpl2.form wizard.import.zpl2 form New
view_wizard_print_product_label_form wizard.print.record.label.form wizard.print.record.label form New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (5)

New fields (19)
  • action_window_id Many2one → ir.actions.act_window
    comodel_name='ir.actions.act_window' readonly=True string='Action'
  • active Boolean
    default=True
  • component_ids One2many → printing.label.zpl2.component
    comodel_name='printing.label.zpl2.component' copy=True help='Components which will be printed on the label.' inverse_name='label_id' string='Label Components'
  • description Char
    help='Long description for this label.'
  • extra Text
    default='{}'
  • labelary_dpmm Selection
    default='8dpmm' required=True selection=[('6dpmm', '6dpmm (152 pdi)'), ('8dpmm', '8dpmm (203 dpi)'), ('12dpmm', '12dpmm (300 pdi)'), ('24dpmm', '24dpmm (600 dpi)')] string='Print density'
  • labelary_height Float
    default=70 string='Height in mm'
  • labelary_image Binary
    compute='_compute_labelary_image' string='Image from Labelary'
  • labelary_width Float
    default=140 string='Width in mm'
  • model_id Many2one → ir.model
    comodel_name='ir.model' help='Model used to print this label.' ondelete='cascade' required=True string='Model'
  • name Char
    help='Label Name.' required=True
  • origin_x Integer
    default=10 help='Origin point of the contents in the label, X coordinate.' required=True
  • origin_y Integer
    default=10 help='Origin point of the contents in the label, Y coordinate.' required=True
  • printer_id Many2one → printing.printer
    comodel_name='printing.printer' string='Printer'
  • record_id Integer
    default=1 string='Record ID'
  • restore_saved_config Boolean
    default=True help="Restore printer's saved configuration and end of each label " string="Restore printer's configuration"
  • test_labelary_mode Boolean
    string='Mode Labelary'
  • test_print_mode Boolean
    string='Mode Print'
  • width Integer
    default=480 help='Width of the label, will be set on the printer before printing.' required=True
Public methods (8)
  • add_action(self, model_id)
    @api.model
  • check_recursion(self)
    @api.constrains('component_ids')
  • create_action(self)
  • import_zpl2(self)
  • new_action(self, model_id)
    @api.model
  • print_label(self, printer, record, page_count=1, **extra)
  • print_test_label(self)
  • unlink_action(self)

New fields (45)
  • bar_width_ratio Float
    default=3.0 help='Ratio between wide bar and narrow bar.'
  • block_justify Selection
    default='L' help='Choose how the text will be justified in the block.' required=True selection=[(str(zpl2.JUSTIFY_LEFT), 'Left'), (str(zpl2.JUSTIFY_CENTER), 'Center'), (str(zpl2.JUSTIFY_JUSTIFIED), 'Justified'), (str(zpl2.JUSTIFY_RIGHT), 'Right')] string='Justify'
  • block_left_margin Integer
    help='Left margin for the second and other lines in the block.' string='Left Margin'
  • block_lines Integer
    default=1 help='Maximum number of lines to print in the block.'
  • block_spaces Integer
    help='Number of spaces added between lines in the block.'
  • block_width Integer
    help='Width of the block.'
  • check_digits Boolean
    help='Check if you want to compute and print the check digit.'
  • color Selection
    default=str(zpl2.COLOR_BLACK) help='Color of the line to draw.' selection=[(str(zpl2.COLOR_BLACK), 'Black'), (str(zpl2.COLOR_WHITE), 'White')]
  • columns_count Integer
    help='Number of data columns to encode.'
  • component_type Selection
    default='text' help='Type of content, simple text or barcode.' required=True selection=[('text', 'Text'), ('rectangle', 'Rectangle / Line'), ('diagonal', 'Diagonal Line'), ('circle', 'Circle'), ('graphic', 'Graphic'), (str(zpl2.BARCODE_CODE_11), 'Code 11'), (str(zpl2.BARCODE_INTERLEAVED_2_OF_5), 'Interleaved 2 of 5'), (str(zpl2.BARCODE_CODE_39), 'Code 39'), (str(zpl2.BARCODE_CODE_49), 'Code 49'), (str(zpl2.BARCODE_PDF417), 'PDF417'), (str(zpl2.BARCODE_EAN_8), 'EAN-8'), (str(zpl2.BARCODE_UPC_E), 'UPC-E'), (str(zpl2.BARCODE_CODE_128), 'Code 128'), (str(zpl2.BARCODE_EAN_13), 'EAN-13'), (str(zpl2.BARCODE_QR_CODE), 'QR Code'), ('sublabel', 'Sublabel'), ('zpl2_raw', 'ZPL2')] string='Type'
  • data Text
    default=<expr> help='Data to print on this component. Resource values can be inserted with %(object.field_name)s.' required=True
  • data_autofill Boolean
    help="Change 'data' with dictionary of the object information." string='Autofill Data'
  • diagonal_orientation Selection
    default=str(zpl2.DIAGONAL_ORIENTATION_LEFT) help='Orientation of the diagonal line.' selection=[(str(zpl2.DIAGONAL_ORIENTATION_LEFT), 'Left (\\)'), (str(zpl2.DIAGONAL_ORIENTATION_RIGHT), 'Right (/)')]
  • error_correction Selection
    default=str(zpl2.ERROR_CORRECTION_HIGH) help='Error correction for some barcode types like QR Code.' required=True selection=[(str(zpl2.ERROR_CORRECTION_ULTRA_HIGH), 'Ultra-high Reliability Level'), (str(zpl2.ERROR_CORRECTION_HIGH), 'High Reliability Level'), (str(zpl2.ERROR_CORRECTION_STANDARD), 'Standard Level'), (str(zpl2.ERROR_CORRECTION_HIGH_DENSITY), 'High Density Level')]
  • font Selection
    default=str(zpl2.FONT_DEFAULT) help='Font to use, for text only.' required=True selection=[(str(zpl2.FONT_DEFAULT), 'Default'), (str(zpl2.FONT_9X5), '9x5'), (str(zpl2.FONT_11X7), '11x7'), (str(zpl2.FONT_18X10), '18x10'), (str(zpl2.FONT_28X15), '28x15'), (str(zpl2.FONT_26X13), '26x13'), (str(zpl2.FONT_60X40), '60x40'), (str(zpl2.FONT_21X13), '21x13')]
  • graphic_image Binary
    attachment=True help='This field holds a static image to print. If not set, the data field is evaluated.' string='Image'
  • height Integer
    help='Height of the printed component. For a text component, height of a single character.'
  • in_block Boolean
    help='If checked, the data will be restrected in a defined block on the label.'
  • interpretation_line Boolean
    help='Check if you want the interpretation line to be printed.'
  • interpretation_line_above Boolean
    help='Check if you want the interpretation line to be printed above the barcode.'
  • label_id Many2one → printing.label.zpl2
    comodel_name='printing.label.zpl2' help='Label using this component.' ondelete='cascade' required=True string='Label'
  • magnification_factor Integer
    default=1 help='Magnification Factor, from 1 to 10.'
  • mask_value Integer
    default=7 help='Mask Value, from 0 to 7.'
  • model Selection
    default=str(zpl2.MODEL_ENHANCED) help='Barcode model, used by some barcode types like QR Code.' selection=[(str(zpl2.MODEL_ORIGINAL), 'Original'), (str(zpl2.MODEL_ENHANCED), 'Enhanced')]
  • model_id Many2one → ir.model
    comodel_name='ir.model' compute='_compute_model_id' string="Record's model"
  • module_width Integer
    default=2 help='Module width for the barcode.'
  • name Char
    help='Name of the component.' required=True
  • only_product_barcode Boolean
    args: 'Only product barcode data'
  • orientation Selection
    default=str(zpl2.ORIENTATION_NORMAL) help='Orientation of the barcode.' required=True selection=[(str(zpl2.ORIENTATION_NORMAL), 'Normal'), (str(zpl2.ORIENTATION_ROTATED), 'Rotated'), (str(zpl2.ORIENTATION_INVERTED), 'Inverted'), (str(zpl2.ORIENTATION_BOTTOM_UP), 'Read from Bottom up')]
  • origin_x Integer
    default=10 help='Origin point of the component in the label, X coordinate.' required=True
  • origin_y Integer
    default=10 help='Origin point of the component in the label, Y coordinate.' required=True
  • repeat Boolean
    help='Check this box to repeat this component on the label.' string='Repeatable'
  • repeat_count Integer
    default=1 help='Maximum count of repeats of the component.'
  • repeat_offset Integer
    default=0 help='Number of elements to skip when reading a list of elements.'
  • repeat_offset_x Integer
    help='X coordinate offset between each occurence of this component on the label.'
  • repeat_offset_y Integer
    help='Y coordinate offset between each occurence of this component on the label.'
  • reverse_print Boolean
    help='If checked, the data will be printed in the inverse color of the background.'
  • rounding Integer
    help='Rounding of the printed rectangle corners.'
  • rows_count Integer
    help='Number of rows to encode.'
  • security_level Integer
    help='Security level for error detection.'
  • sequence Integer
    help='Order used to print the elements.'
  • sublabel_id Many2one → printing.label.zpl2
    comodel_name='printing.label.zpl2' help='Another label to include into this one as a component. This allows to define reusable labels parts.' string='Sublabel'
  • thickness Integer
    help='Thickness of the line to draw.'
  • truncate Boolean
    help='Check if you want to truncate the barcode.'
  • width Integer
    help='Width of the printed component. For a text component, width of a single character.'
Public methods (6)
  • action_minus_origin_x(self)
  • action_minus_origin_y(self)
  • action_plus_origin_x(self)
  • action_plus_origin_y(self)
  • autofill_data(self, record, eval_args)
    @api.model
  • process_model(self, model)

New fields (3)
  • data Text
    help='Printer used to print the labels.' required=True
  • delete_component Boolean
    default=False string='Delete existing components'
  • label_id Many2one → printing.label.zpl2
    comodel_name='printing.label.zpl2' readonly=True required=True string='Label'
Public methods (1)
  • import_zpl2(self)

New fields (5)
  • active_model_id Many2one → ir.model
    comodel_name='ir.model' domain=<expr> string='Model'
  • label_id Many2one → printing.label.zpl2
    comodel_name='printing.label.zpl2' domain=<expr> help='Label to print.' required=True string='Label'
  • line_ids One2many → wizard.print.record.label.line
    args: 'wizard.print.record.label.line', 'label_header_id'
  • model Char
    related='active_model_id.model' string='Model Name'
  • printer_id Many2one → printing.printer
    comodel_name='printing.printer' help='Printer used to print the labels.' required=True string='Printer'
Public methods (2)
  • default_get(self, fields_list)
    @api.model
  • print_label(self)
    Prints a label per selected record

New fields (2)
  • label_header_id Many2one → wizard.print.record.label
    comodel_name='wizard.print.record.label'
  • label_no Integer
    string='# labels'
Public methods (0)

No public methods.

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Status
Open migration PR — not merged yet for this version
CI status
green — ready to merge
Open since
53 days ago
Last activity
46 days ago
Repository
OCA/report-print-send
Pull request
[19.0][MIG] printer_zpl2 (#466)