Skip to content

Barcode Validate Documentation

Overview

The Barcode Validate module (barcode.validate) provides a barcode-scanning interface for validating pending stock pickings. It allows warehouse staff to verify picked quantities against planned quantities and handle discrepancies through backorders or inventory loss adjustments.


Model Information

Model Name: barcode.validate
Display Name: Barcode Validate
Key Fields: None (transient model)

Features

  • ❌ Audit logging disabled (transient model)
  • ✅ Transient model (wizard - session data)
  • ✅ Backorder support
  • ✅ Inventory loss tracking

Purpose

  • ✅ Validate picked quantities via barcode
  • ✅ Compare actual vs planned quantities
  • ✅ Create backorders for short-shipped items
  • ✅ Record inventory losses
  • ✅ Complete pending pickings

Validation Modes

Mode Code Description
Backorder backorder Creates new picking for undelivered qty
Inventory Loss loss Records missing qty as inventory loss

Key Fields Reference

Header Fields

Field Type Required Description
picking_id Many2One Pending picking to validate
mode Selection backorder/loss
location_loss_id Many2One Inventory loss location

Line Fields (barcode.validate.line)

Field Type Required Description
wizard_id Many2One Parent wizard
product_id Many2One Product
qty_planned Decimal Planned quantity
qty_actual Decimal Actually picked quantity
uom_id Many2One Unit of measurement
lot_id Many2One Lot/serial number
container_to_id Many2One Container
location_from_id Many2One Source location
location_to_id Many2One Destination location

API Methods

1. Fill Products

Method: fill_products(ids, context)

Loads products from selected picking.

Example:

wizard.write({"picking_id": picking_id})
wizard.fill_products()
# Loads all picking lines with planned quantities


2. Validate

Method: validate(ids, context)

Validates picking with actual quantities.

Behavior: - Backorder mode: Creates new picking for shortages - Loss mode: Records differences as inventory loss

Example:

# Validate with backorder for shortages
wizard.write({"mode": "backorder"})
wizard.validate()

# Validate with inventory loss
wizard.write({
    "mode": "loss",
    "location_loss_id": loss_location_id
})
wizard.validate()


Common Use Cases

Use Case 1: Validate Picking with Barcode

# 1. Create validation session
wizard_id = get_model("barcode.validate").create({
    "picking_id": pending_picking_id,
    "mode": "backorder"
})

wizard = get_model("barcode.validate").browse(wizard_id)

# 2. Load products
wizard.fill_products()

# 3. Scan and update actual quantities
for line in wizard.lines:
    # Scan product barcode
    # Update actual qty
    line.write({"qty_actual": scanned_qty})

# 4. Validate
wizard.validate()
# Creates backorder if qty_actual < qty_planned

Use Case 2: Handle Inventory Loss

# When products are damaged/missing

wizard_id = get_model("barcode.validate").create({
    "picking_id": picking_id,
    "mode": "loss",
    "location_loss_id": inventory_loss_loc_id
})

wizard = get_model("barcode.validate").browse(wizard_id)
wizard.fill_products()

# Update actual quantities (less than planned)
for line in wizard.lines:
    line.write({"qty_actual": damaged_qty})

# Validate - records loss
wizard.validate()

Best Practices

1. Always Specify Mode

# Good: Clear handling of discrepancies
wizard.write({"mode": "backorder"})

# Avoid: Unclear what happens to shortages
wizard.validate()  # What happens to missing qty?

2. Validate Actual Quantities

# Good: Check before validating
for line in wizard.lines:
    if not line.qty_actual:
        raise Exception(f"Missing qty for {line.product_id.code}")

wizard.validate()

Model Relationship Description
barcode.validate.line One2Many Validation lines
stock.picking Many2One Picking being validated
pick.validate Created Validation record
stock.location Many2One Loss location

Troubleshooting

"Product list is empty"

Cause: No lines loaded
Solution: Call fill_products() first

"Missing actual qty"

Cause: qty_actual not set on lines
Solution: Scan all products and update quantities


Version History

Last Updated: October 2025
Model Version: barcode_validate.py
Framework: Netforce


This documentation is generated for developer onboarding and reference purposes.