Skip to main content

Troubleshooting and FAQ

Common Issues

Equipment Code Not Generated

  • Verify the module sdlc_maintenance_qr_code is installed and up to date
  • For existing equipment, click the Generate Code button -- this requires Equipment Manager group membership
  • New equipment receives codes automatically on creation regardless of user group

Generate Code Button Not Visible

  • The button is only visible to users in the Equipment Manager group (maintenance.group_equipment_manager)
  • The button is hidden once an equipment code has already been assigned
  • Check your user's groups under Settings > Users & Companies > Users

QR Code Not Displaying

  • Ensure the equipment has an assigned Equipment Code -- QR fields are empty when no code exists
  • Navigate to the QR Code tab on the equipment form to view the preview
  • QR fields recompute automatically when x_equipment_code or company_id changes

Duplicate Code Error

  • A SQL uniqueness constraint (UNIQUE(x_equipment_code)) prevents duplicate codes
  • This should not occur under normal operation since codes are assigned via ir.sequence
  • If you encounter this error, check if the sequence was manually modified

Labels Not Aligned When Printing

  • Set your printer to "Actual size" (not "Fit to page")
  • The PDF uses zero-margin A4 portrait format -- ensure your printer supports borderless printing
  • Check that the correct label layout matches your physical label sheets

Special Characters Appearing Incorrectly on Labels

  • The module includes built-in mojibake repair (_repair_mojibake) for corrupted UTF-8 text
  • HTML entity encoding (_qr_display_html_entities) handles special characters in PDF rendering
  • If issues persist, check the original equipment name for encoding problems

QR Code Scan Opens Login Page

  • The scanning user must be logged into Odoo in their browser
  • After authentication, the user will be forwarded to the equipment record
  • Ensure the Odoo instance URL is accessible from the scanning device's network

Data Model Reference

maintenance.equipment (Extended)

FieldTypePropertiesDescription
x_equipment_codeCharunique, indexed, tracked, copy=FalseAuto-generated equipment code (MEQ/YYYY/NNNNN)
x_qr_payloadCharcomputed, readonlyFull URL encoded in the QR code
x_qr_urlCharcomputed, readonlyURL to the barcode image endpoint
x_qr_image_htmlHtmlcomputed, readonly, sanitize=FalseHTML img tag rendering the QR code
x_qr_name_displayCharcomputedMojibake-repaired equipment name for display
x_qr_name_entitiesCharcomputedHTML-entity-encoded name for safe PDF rendering

Key Methods

MethodDescription
create(vals_list)Overridden to auto-assign equipment code on creation
action_generate_equipment_code()Button action for manually generating codes (manager only)
action_open_qr_print_wizard()Opens the print wizard modal with selected equipment
_assign_equipment_code_if_needed()Assigns next code from ir.sequence if not already set
_compute_qr_fields()Computes QR payload, URL, and HTML image
_repair_mojibake(text)Static: fixes UTF-8 text decoded as latin-1/cp1252
_qr_display_html_entities(text)Static: converts text to HTML entities
_qr_display_code()Returns equipment code or empty string for report use

maintenance.qr.print.wizard (Transient)

FieldTypeDefaultDescription
equipment_idsMany2manyFrom contextEquipment records to print labels for
copiesInteger1Number of copies per equipment
sizeSelection2x7xpriceLabel layout (dymo, 2x7, 4x7, custom)
custom_columnsInteger2Custom column count
custom_rowsInteger7Custom row count
header_colorChar#6b4096Label header background color
rowsIntegercomputedEffective row count
columnsIntegercomputedEffective column count

Report Abstract Model

Model: report.sdlc_maintenance_qr_code.report_maintenance_equipment_qr (AbstractModel)

The _get_report_values() method returns:

KeyDescription
pagesList of pages, each page is a list of rows, each row is a list of equipment
columnsNumber of columns per row
rowsNumber of rows per page
qr_pxQR code pixel size (260, 280, or 320)
header_colorHex color for the label header
companyCurrent company record

Report Engine

Report Action

PropertyValue
Report IDaction_report_maintenance_equipment_qr
Modelmaintenance.qr.print.wizard
Report Typeqweb-pdf
Report Namesdlc_maintenance_qr_code.report_maintenance_equipment_qr

QWeb Templates

TemplatePurpose
report_simple_qr_label_cellRenders a single label cell (header + QR + code + name)
report_maintenance_equipment_qrMain report: iterates pages > rows > cells, calling the cell template

Module Information

DetailValue
Module Namesdlc_maintenance_qr_code
Display NameSDLC Maintenance QR Code
Version17.0.1.0.0 / 18.0.1.0.0 / 19.0.1.0.0
CategoryMaintenance
AuthorSDLC Corp
LicenseLGPL-3
Dependenciesmaintenance
Models1 extended (maintenance.equipment) + 1 transient (wizard) + 1 abstract (report)
Views3 inherited (form, tree, search) + 1 wizard form
Reports1 QWeb PDF report with 2 templates

Support

ChannelDetails
Websitesdlccorp.com
Emailsales@sdlccorp.com
Compatible OdooOdoo 17, 18, 19 Community Edition
LicenseLGPL-3
Need Help?

Contact SDLC Corp at sdlccorp.com/contact-us or email sales@sdlccorp.com