Test Report — 18.0.1.0.0
What is tested in Product Barcode & Label Printing, and how to run the suite.
Result: 72 automated tests, 0 failures, 0 errors. Exit code 0.
Every figure here comes from an actual run. The rendering tests render the real report through Odoo's own QWeb engine and read the HTML that comes out.
Environment
| Odoo | 18.0 (community, source checkout) |
| Python | 3.12.3 |
| PostgreSQL | 16.15 |
| OS | Ubuntu 24.04.1 LTS |
| Database | created fresh for the run |
| Command | odoo-bin -d <db> -i technovision_barcode_labels --test-enable --test-tags /technovision_barcode_labels --stop-after-init |
Result
Tests started : 72
Failures : 0
Errors : 0
Odoo exit code: 0The run emits one ERROR line from PostgreSQL — a duplicate template name — produced deliberately by test_duplicate_name_refused.
Coverage by area
| Suite | Tests | Covers |
|---|---|---|
| TestRendering | 20 | The rendered HTML: positions in millimetres, page sizing, which fields appear, font sizes, barcode symbology selection, and the paperformat a roll gets |
| TestPrintWizard | 15 | Prefilling from a selection, pricing, quantity validation, the limit, and the action returned |
| TestTemplate | 14 | Page and label geometry, the fit check, the shipped layouts, and every refusal |
| TestLayout | 14 | Labels arranged into pages, quantities expanded, start position and its blanks |
| TestSecurity | 9 | Designer versus ordinary user versus portal user, on templates and on printing |
| Total | 72 |
What the tests actually prove
A layout that cannot fit is refused when you save it. test_a_layout_that_cannot_fit_is_refused and test_margins_larger_than_the_page_are_refused assert that the arithmetic is checked at save time. The alternative is discovering it after a hundred labels have come out wrong, which is the failure this module exists to prevent.
The geometry reaches the paper. test_the_page_is_sized_in_millimetres, test_labels_are_positioned_across_and_down and test_a_roll_page_is_the_size_of_the_label read the millimetre values out of the rendered HTML rather than trusting the computed fields. A label two millimetres out is a ruined sheet.
Start position wastes nothing. test_start_position_leaves_blanks, test_start_position_pushes_the_page_count_up and test_blank_leading_cells_draw_nothing assert that a part-used sheet resumes at the right cell, that the blanks are genuinely empty, and that the page count accounts for them.
Barcodes are chosen, not guessed. test_a_valid_ean_is_drawn_as_ean13 asserts EAN-13 is used only when the code really is thirteen valid digits; test_a_non_numeric_barcode_falls_back_to_code128 asserts the fallback; test_a_forced_symbology_is_respected asserts an explicit choice wins; and test_a_product_without_a_barcode_says_so asserts a missing barcode is stated on the label rather than silently omitted.
Nothing else in the database is disturbed. test_other_reports_are_untouched asserts that the get_paperformat() override returns the parent result for every report that is not one of this module's own label runs. test_the_paperformat_is_reused_not_duplicated asserts that resizing a roll template updates its paperformat instead of accumulating new ones.
Printing is for everyone; designing is not. TestSecurity asserts that an ordinary internal user can print and read templates but cannot create, change or delete one, that a Label Designer can, and that a portal user reaches none of it.
Known gaps in coverage
Stated rather than glossed over:
- No PDF is generated in the suite. The tests assert the HTML that QWeb produces, which is what determines the layout. Turning that into a PDF is wkhtmltopdf's job and needs the binary present; it was verified manually on real stationery, which is the only test that actually counts for a label.
- No browser (tour) tests. The wizard is covered on the server side. There is no automated click-through of the rendered form.
- Printer behaviour. Margins, scaling and roll feed are properties of the printer driver, not of this module. See TROUBLESHOOTING.md.
- Odoo 19. Not tested; this release targets 18.0 only.
Reproducing
createdb -O odoo pbl_test
odoo-bin -c odoo.conf -d pbl_test \
-i technovision_barcode_labels --test-enable \
--test-tags /technovision_barcode_labels --stop-after-init
echo "exit code: $?"A clean run prints no FAIL: or ERROR: Test lines and exits 0.