diff --git a/setup/stock_picking_product_barcode_report_lot_label/odoo/addons/stock_picking_product_barcode_report_lot_label b/setup/stock_picking_product_barcode_report_lot_label/odoo/addons/stock_picking_product_barcode_report_lot_label new file mode 120000 index 00000000..a214e760 --- /dev/null +++ b/setup/stock_picking_product_barcode_report_lot_label/odoo/addons/stock_picking_product_barcode_report_lot_label @@ -0,0 +1 @@ +../../../../stock_picking_product_barcode_report_lot_label \ No newline at end of file diff --git a/setup/stock_picking_product_barcode_report_lot_label/setup.py b/setup/stock_picking_product_barcode_report_lot_label/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/stock_picking_product_barcode_report_lot_label/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_picking_product_barcode_report_lot_label/README.rst b/stock_picking_product_barcode_report_lot_label/README.rst new file mode 100644 index 00000000..92e33dc1 --- /dev/null +++ b/stock_picking_product_barcode_report_lot_label/README.rst @@ -0,0 +1,77 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============================================== +Stock Picking Product Barcode Report Lot Label +============================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f3aef39d549fcf348f2250edf250b261d0f7cce36dbdd8c4674e1f8c647112a2 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-qrtl%2Faxls--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/axls-custom/tree/16.0/stock_picking_product_barcode_report_lot_label + :alt: qrtl/axls-custom + +|badge1| |badge2| |badge3| + +The product barcode label of ``stock_picking_product_barcode_report`` +prints the lot/serial number as plain text only, so a warehouse operator +has to key it in by hand when the label is scanned. + +This module adds a second, scannable Code128 barcode carrying the +lot/serial number underneath the product barcode, on labels that have a +lot/serial number assigned. + +Labels printed in GS1-128 format are left untouched: that barcode +already carries the lot in application identifier ``(10)``, so a second +symbol would only duplicate it. + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Quartile + +Maintainers +----------- + +.. |maintainer-nobuQuartile| image:: https://github.com/nobuQuartile.png?size=40px + :target: https://github.com/nobuQuartile + :alt: nobuQuartile + +Current maintainer: + +|maintainer-nobuQuartile| + +This module is part of the `qrtl/axls-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/stock_picking_product_barcode_report_lot_label/__init__.py b/stock_picking_product_barcode_report_lot_label/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/stock_picking_product_barcode_report_lot_label/__manifest__.py b/stock_picking_product_barcode_report_lot_label/__manifest__.py new file mode 100644 index 00000000..7be18a3c --- /dev/null +++ b/stock_picking_product_barcode_report_lot_label/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Stock Picking Product Barcode Report Lot Label", + "summary": "Add a scannable lot/serial barcode to the product barcode label", + "version": "16.0.1.0.0", + "author": "Quartile", + "website": "https://www.quartile.co", + "category": "Inventory", + "license": "AGPL-3", + "maintainers": ["nobuQuartile"], + "depends": ["stock_picking_product_barcode_report"], + "data": [ + "report/report_label_barcode_template.xml", + ], + "installable": True, +} diff --git a/stock_picking_product_barcode_report_lot_label/readme/DESCRIPTION.md b/stock_picking_product_barcode_report_lot_label/readme/DESCRIPTION.md new file mode 100644 index 00000000..740fbf29 --- /dev/null +++ b/stock_picking_product_barcode_report_lot_label/readme/DESCRIPTION.md @@ -0,0 +1,11 @@ +The product barcode label of `stock_picking_product_barcode_report` prints the +lot/serial number as plain text only, so a warehouse operator has to key it in +by hand when the label is scanned. + +This module adds a second, scannable Code128 barcode carrying the lot/serial +number underneath the product barcode, on labels that have a lot/serial number +assigned. + +Labels printed in GS1-128 format are left untouched: that barcode already +carries the lot in application identifier `(10)`, so a second symbol would only +duplicate it. diff --git a/stock_picking_product_barcode_report_lot_label/report/report_label_barcode_template.xml b/stock_picking_product_barcode_report_lot_label/report/report_label_barcode_template.xml new file mode 100644 index 00000000..10e68501 --- /dev/null +++ b/stock_picking_product_barcode_report_lot_label/report/report_label_barcode_template.xml @@ -0,0 +1,21 @@ + + + + diff --git a/stock_picking_product_barcode_report_lot_label/static/description/index.html b/stock_picking_product_barcode_report_lot_label/static/description/index.html new file mode 100644 index 00000000..480a9db5 --- /dev/null +++ b/stock_picking_product_barcode_report_lot_label/static/description/index.html @@ -0,0 +1,425 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Stock Picking Product Barcode Report Lot Label

+ +

Beta License: AGPL-3 qrtl/axls-custom

+

The product barcode label of stock_picking_product_barcode_report +prints the lot/serial number as plain text only, so a warehouse operator +has to key it in by hand when the label is scanned.

+

This module adds a second, scannable Code128 barcode carrying the +lot/serial number underneath the product barcode, on labels that have a +lot/serial number assigned.

+

Labels printed in GS1-128 format are left untouched: that barcode +already carries the lot in application identifier (10), so a second +symbol would only duplicate it.

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Quartile
  • +
+
+
+

Maintainers

+

Current maintainer:

+

nobuQuartile

+

This module is part of the qrtl/axls-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+
+ + diff --git a/stock_picking_product_barcode_report_lot_label/tests/__init__.py b/stock_picking_product_barcode_report_lot_label/tests/__init__.py new file mode 100644 index 00000000..84373050 --- /dev/null +++ b/stock_picking_product_barcode_report_lot_label/tests/__init__.py @@ -0,0 +1 @@ +from . import test_report_label_barcode_lot diff --git a/stock_picking_product_barcode_report_lot_label/tests/test_report_label_barcode_lot.py b/stock_picking_product_barcode_report_lot_label/tests/test_report_label_barcode_lot.py new file mode 100644 index 00000000..de3c5e13 --- /dev/null +++ b/stock_picking_product_barcode_report_lot_label/tests/test_report_label_barcode_lot.py @@ -0,0 +1,66 @@ +# Copyright 2026 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo.tests import TransactionCase, tagged + +REPORT_NAME = "stock_picking_product_barcode_report.label_barcode_report" + + +@tagged("post_install", "-at_install") +class TestReportLabelBarcodeLot(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.product = cls.env["product.product"].create( + { + "name": "Test Tracked Product", + "type": "product", + "tracking": "lot", + # 13 digits so the base template takes its EAN13 branch, which is + # the one an existing installation is most likely to be printing. + "barcode": "5901234123457", + } + ) + cls.lot = cls.env["stock.lot"].create( + { + "name": "LOT-0001", + "product_id": cls.product.id, + "company_id": cls.env.company.id, + } + ) + + def _create_line(self, lot=None, wizard=None): + return self.env["stock.picking.line.print"].create( + { + "product_id": self.product.id, + "quantity": 1.0, + "label_qty": 1, + "uom_id": self.product.uom_id.id, + "lot_id": lot.id if lot else False, + "wizard_id": wizard.id if wizard else False, + } + ) + + def _render(self, line): + html = self.env["ir.actions.report"]._render_qweb_html(REPORT_NAME, line.ids)[0] + return html.decode() + + def _count_barcodes(self, html): + return html.count("/report/barcode/") + + def test_lot_barcode_added(self): + """A line with a lot gets a second barcode carrying the lot name.""" + html = self._render(self._create_line(lot=self.lot)) + self.assertEqual(self._count_barcodes(html), 2) + self.assertIn("value=%s" % self.lot.name, html) + + def test_no_lot_no_extra_barcode(self): + """A line without a lot keeps the single product barcode.""" + html = self._render(self._create_line()) + self.assertEqual(self._count_barcodes(html), 1) + + def test_gs1_format_not_duplicated(self): + """GS1-128 already encodes the lot, so no second barcode is added.""" + wizard = self.env["stock.picking.print"].create({"barcode_format": "gs1_128"}) + html = self._render(self._create_line(lot=self.lot, wizard=wizard)) + self.assertEqual(self._count_barcodes(html), 1) + self.assertIn("(10)%s" % self.lot.name, html)