Barcode Scrap
barcode_scrap · OCA/barcode-interface
-
Security25/25No findings
-
Activity25/25Human commit this month
-
Required by5/250 modules depend on it
-
Maturity5/25In 1 Odoo series since 18.0
Heuristic over the facts below, not an audit · How it's computed
Description
Scrap damaged or lost goods directly from the Barcode scanner app.
The operator picks the internal location the goods are written off from, scans
them (with a GS1 parser installed, a GS1 label also gives its lot/serial and
piece count), sets
the quantities, chooses the scrap reasons and scraps. Each line becomes a
native stock.scrap, created and validated on the spot, so the stock leaves the
location for the scrap location exactly as it does from the back office.
This is a feature module on top of barcode_scanner: it registers its own
screens, scan handling and home-screen tile into the scanner core without
patching it, so you install only what you need.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 0
No views found for this module.
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 1
No new fields.
Public methods (3)-
action_barcode_scrap(self, location_id, lines, reason_tag_ids=None, force=False, scrap_location_id=None)@api.modelScrap the scanned lines from one location and validate them at once. One ``stock.scrap`` is created per line, carrying the chosen scrap reasons, and validated on the spot. When a line asks for more than the location holds, nothing is written unless ``force`` is set: the lines short of stock are returned so the scanner can ask the operator to confirm. That is the choice the back office offers through its insufficient-quantity wizard, and confirming does what that wizard does -- the scrap is done regardless. ``scrap_location_id`` is where the goods go; it must be a scrap location of the company. Left empty, the scrap gets the company's default one, as in the back office, or the first allowed one when the company has none of its own. -
action_barcode_scrap_create_reason(self, name)@api.modelCreate a scrap reason from the scanner, as the back office's reason field quick-creates one from a typed name. A reason that already exists under the same name, whatever its case, is returned instead of creating a near-duplicate operators would then have to tell apart. -
action_barcode_scrap_location_stock(self, location_id)@api.modelReturn what a location holds that a scrap can take, per product and lot: one entry each. The scanner shows it next to each line (how much there is to scrap) and offers only the lots actually stored there. It counts what validating the scrap counts (see ``_barcode_scrap_available_qty``): the net quantity at the location itself, outside packages and not owned by a partner, so the screen and the validation never disagree.