Skip to content

feat: beam_barcode_resolver hook#337

Merged
agritheory merged 2 commits intoversion-15from
feat-beam_barcode_resolver_hooks
Mar 15, 2026
Merged

feat: beam_barcode_resolver hook#337
agritheory merged 2 commits intoversion-15from
feat-beam_barcode_resolver_hooks

Conversation

@lauty95
Copy link
Copy Markdown
Collaborator

@lauty95 lauty95 commented Mar 11, 2026

Add extension points to BEAM's scan pipeline so that other apps can handle barcode scans on custom forms

New hooks

  • beam_barcode_resolver:
    Fallback barcode resolution for doctypes that aren't Item, Handling Unit, or standard ERPNext barcodes. Apps register a resolver function that receives the barcode string and returns a frappe._dict(doc=..., barcode=...) or None.

  • beam_frm override in get_form_action():
    When a scanned Handling Unit or Item lands on a form that doesn't have a standard {Doctype} Item child table, get_item_details() would fail with a 404. The new has_frm_override check skips that call and builds a minimal target instead.

@github-actions
Copy link
Copy Markdown

📝 Draft Changelog Entry

Changelog

A new barcode resolver hook has been added to the scanning module. This hook provides additional functionality for barcode resolution within the beam scanning system.

This changelog entry was automatically generated by the Changelog Generator Action.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 11, 2026

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py10100% 
hooks.py150100% 
install.py24240%4, 6, 9–17, 20–21, 24, 27–28, 30–31, 33, 35–36, 38, 42–43
beam
   __init__.py00100% 
   barcodes.py1053863%21, 30, 36–37, 44, 56, 78–79, 81–82, 88–90, 92–94, 101–103, 109, 119, 127, 134, 137–138, 144–145, 151, 157, 163, 169, 181, 184–187, 189–190
   boot.py12120%4, 6, 9–12, 17, 19–20, 24–25, 28
   handling_unit.py763751%29, 32, 53–55, 73, 84–85, 91–92, 94–95, 97–98, 100–101, 103, 105–108, 110–112, 114, 116, 118–119, 124, 126, 130, 132–133, 136, 138–139, 147
   printing.py935540%18–19, 48, 50–53, 62–66, 70–71, 83–87, 91, 97, 106–112, 114–115, 117, 122, 124–125, 140–145, 147–153, 160–163, 165–168
   zpl_layout.py2462460%12–15, 17, 20, 36, 47–48, 51–52, 54–55, 58, 61, 64–67, 69–71, 77, 81–83, 86–87, 90–91, 93–94, 99, 101, 110–111, 113, 115, 118–120, 122–125, 128–129, 132, 140–141, 144–146, 154, 157, 161, 164, 167, 177–183, 185, 188, 193–196, 198, 201–206, 209–215, 217, 219, 222, 224–227, 231–233, 235–239, 241–245, 249–253, 258, 260, 263–269, 278–282, 285–292, 295–308, 311–313, 316–328, 331, 334–336, 339–353, 356–361, 364, 366, 369, 384, 386–387, 390–391, 393, 395, 397–399, 402, 411, 418–420, 423–424, 427, 429–433, 436, 439–442, 445–448, 451–453, 469, 471, 474–475, 496–501, 505, 507–508, 516–521, 524–525
beam/doctype
   __init__.py00100% 
beam/doctype/beam_settings
   __init__.py00100% 
   beam_settings.py17570%14–18
beam/doctype/handling_unit
   __init__.py9366%12–14
   handling_unit.py16193%16
   test_handling_unit.py30100% 
beam/overrides
   network_printer_settings.py403220%14–18, 24–34, 42–46, 49, 52–55, 57–62
   stock_entry.py911682%115–116, 121–128, 134–135, 151, 183, 186–187
beam/print_format
   __init__.py00100% 
beam/print_format/handling_unit_6x4_zpl_format
   __init__.py00100% 
beam/print_format/handling_unit_label
   __init__.py00100% 
beam/print_format/item_barcode
   __init__.py00100% 
beam/print_format/labelary_print_preview
   __init__.py00100% 
beam/print_format/microqr_serial_no
   __init__.py00100% 
beam/print_format/warehouse_barcode
   __init__.py00100% 
beam/report
   __init__.py00100% 
beam/report/handling_unit_traceability
   __init__.py00100% 
   handling_unit_traceability.py44440%4–6, 9–11, 30–32, 34–35, 37–38, 41–42, 45–46, 48–49, 51–52, 54–55, 57, 63–65, 67–69, 71, 74–77, 79–81, 83–86, 89–90
beam/scan
   __init__.py1973582%23, 33, 89–91, 167–168, 178, 180–181, 185, 189–190, 193, 199, 234, 243, 272, 274, 302–303, 309–316, 323, 331, 345, 451, 459, 466
   config.py26260%4, 6, 9–17, 19–21, 23–26, 28–30, 32–35, 37
tests
   conftest.py240100% 
   test_barcode_auto_generate.py51394%23–25
   test_handling_unit.py4675987%18–19, 21–22, 543, 567, 608, 618, 645, 648–649, 652–661, 668–671, 680–682, 684–685, 687–689, 697, 704, 706–712, 714, 724–727, 736–739, 741–743, 751, 758–760, 762
   test_hooks_override.py39197%41
   test_item_barcode_print_format.py140100% 
   test_printing.py400100% 
   test_scan.py240100% 
   test_serial_number.py540100% 
www
   __init__.py00100% 
TOTAL172863763% 

@lauty95 lauty95 marked this pull request as ready for review March 11, 2026 17:51
@lauty95 lauty95 marked this pull request as draft March 12, 2026 13:13
@lauty95 lauty95 marked this pull request as ready for review March 12, 2026 16:16
@lauty95 lauty95 requested a review from agritheory March 12, 2026 16:16
@agritheory agritheory merged commit 5c5b4ba into version-15 Mar 15, 2026
9 checks passed
@agritheory agritheory deleted the feat-beam_barcode_resolver_hooks branch March 15, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants