Skip to content

[18.0][ADD] barcode_inventory: count stock from the Barcode app - #15

Open
szalatyzuzanna wants to merge 1 commit into
OCA:18.0from
BinhexTeam:18.0-add-barcode_inventory
Open

szalatyzuzanna wants to merge 1 commit into
OCA:18.0from
BinhexTeam:18.0-add-barcode_inventory

Conversation

@szalatyzuzanna

@szalatyzuzanna szalatyzuzanna commented Oct 16, 2026 •

Copy link
Copy Markdown

Counts a location's stock from the Barcode app and applies the count as an inventory adjustment of stock_inventory (OCA/stock-logistics-warehouse). It only depends on barcode_scanner and stock_inventory.

What it does

  • An Inventory Adjustment tile: the operator scans or picks an internal location and sees the stock it holds, one line per product and lot.
  • Counting by scanning: a plain barcode adds one unit and, with barcode_gs1 installed, a GS1 label also brings its lot/serial and piece count (without it, the core reads EAN-13 only). The quantity can also be typed, decimals included, and each line shows how far it is from the stock. A product that is not listed is added from the + picker; a tracked line's lot field suggests, as the operator types, the lots the count can use at that location.
  • A serial number counts one unit: reading it again warns instead of counting it twice.
  • Only storable products can be counted: the + picker offers no others, and scanning a service or a non-storable consumable says why it is refused.
  • Applying builds a stock.inventory adjustment of exactly the counted quants, sets the counted quantities and applies them through Odoo's own action_apply_inventory, then closes it; should Odoo not apply them, nothing is recorded. If the stock of a counted product changed while counting, nothing is applied either: the screen shows the stock as it is now and asks whether to apply the count anyway, as the back office does with outdated counts. Each count leaves one adjustment with its moves. While it is applied, the screen takes no scan or change.

It plugs into the app through the barcode_screens and barcode_menu_tiles registries, without patching it.

What a count covers

  • The stock at the location itself, outside packages and not owned by a partner: what the screen can show per product and lot. Sublocations are counted on their own, and stock in a package or owned by someone else is neither shown, changed nor taken into the adjustment.
  • A lot is matched by name exactly first, as lots differing only in case are distinct lots; in another case only when the name matches a single lot. Otherwise a new lot is created, in the location's company unless the product belongs to one.

Access

  • As in the back office, applying a count requires Inventory Administrator rights (stock.group_stock_manager). Other users see a notice instead of the locations, and the server refuses their count.

Dependencies

  • stock-logistics-warehouse is added to oca_dependencies.txt for stock_inventory.

Tests

  • Python: the lines shown (one per product and lot, without sublocations, packages or owned stock), lot matching and creation, the lots suggested, the checks before applying (products that are not storable and quantities that are not numbers among them), the access check, an adjustment Odoo does not apply, stock that changed while counting (applied anyway on request), and applying a count (the adjustment holding the counted quants only), including new products and lots, a count matching the stock, stock split over several quants and a location shared between companies.
  • A HOOT suite run through browser_js: adding up scans on one line, a plain EAN-13 read by the core's parser, serial numbers counted once, the codes a scan is matched by, a scanned product with no stock to count refused, scans waiting while the count is applied (one resolving after Apply included), the count sent once and left as sent, the difference shown on each line, what is sent when applying, the + picker keeping the count and showing only its latest search, and the location screen for administrators and for other users.

@BinhexTeam

@szalatyzuzanna
szalatyzuzanna force-pushed the 18.0-add-barcode_inventory branch 2 times, most recently from ac68795 to ce16ab0 Compare October 19, 2026 08:13
@szalatyzuzanna
szalatyzuzanna marked this pull request as ready for review October 19, 2026 08:19
@szalatyzuzanna
szalatyzuzanna force-pushed the 18.0-add-barcode_inventory branch from ce16ab0 to 58fc687 Compare October 19, 2026 09:57

@oliverg09 oliverg09 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@szalatyzuzanna
szalatyzuzanna force-pushed the 18.0-add-barcode_inventory branch from 58fc687 to 8732d34 Compare October 23, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:barcode_inventory Module barcode_inventory series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants