Stock Counting Via WDC

Stock Counting Via WDC supports two working methods: one for specific product counting and another for full or filtered warehouse counting. In both methods, the warehouse team performs the scanning in WDC, and the scanned data is then used in the Stock Counting document from the back office.

1. Overview

This operation is used when the business wants to perform a physical stock count through the WDC device. Depending on the requirement, the user can either:

  • Count specific products only and then import them into the stock counting document.
  • Preload stock counting lines for a warehouse or filtered set of products such as by category, brand, model, or branch, then scan and update those existing lines.
Important: The code in stock_wdc treats these two methods differently. If the stock counting document has no lines, users should use Import from WDC. If the stock counting document already has lines, users should use Update Qty.

2. Method 1: Specific Product Counting

Step 1: Create the Stock Counting Document from WDC

Open WDC → Operations → Stock Counting. If creation is enabled for the operation, create a new Stock Counting document directly from WDC.

This method is used when the user only wants to count selected products instead of loading all products for a warehouse or filter combination.

[Attach Image Here] WDC Stock Counting - Create / Select Document
WDC Stock Counting - Create / Select Document

Step 2: Scan the Document Number

The warehouse user scans or manually enters the Stock Counting document number. WDC validates that the document is a draft counting document and confirms the warehouse and location.

[Attach Image Here] Scan Stock Counting Document Number
Scan Stock Counting Document Number

Step 3: Scan the Products

The user scans the required specific products from WDC. For each scan, WDC creates a wdc.transaction.lines entry in Draft state.

If applicable, WDC also handles:

  • Lot selection
  • Serial selection
  • Quantity entry
  • Unit of Measure conversion later during import
[Attach Image Here] Scan Specific Products in WDC
Scan Specific Products in WDC

Step 4: Confirm from the Summary Page

Once the scanning is completed, the user opens the Summary page and clicks Confirm.

Based on the current code, this confirmation changes the related wdc.transaction.lines from Draft to Ready To Process.

Actual code behavior: For stock counting, WDC confirmation does not immediately create stock counting lines. It first sets the scanned WDC lines to Ready To Process.
[Attach Image Here] Stock Counting Summary - Confirm Button
Stock Counting Summary - Confirm Button

Step 5: Use Import from WDC in the Stock Counting Form

After confirmation, the back-office user opens the Stock Counting document and clicks Import from WDC.

The import wizard loads only those WDC lines that are in Ready To Process state for that document. For stock counting, the wizard aggregates the scanned lines and inserts them into the stock counting lines.

Important import behavior from code:

  • If the stock counting document already has lines, the system blocks the import.
  • The wizard shows a Counting UoM option such as Base, Purchase, or Counting if enabled.
  • After import, the related wdc.transaction.lines are updated to Processed.
Code note: In wdc.import.document.wizard, if the stock counting document already contains adjustment lines, the system raises an error telling the user to use Update Quantity instead of import.
[Attach Image Here] Import from WDC in Stock Counting Form
Import from WDC in Stock Counting Form

3. Method 2: Warehouse / Filter Based Counting

Step 1: Create the Document from Back Office

In this method, the back-office user creates the Stock Counting document from the normal Odoo screen, not from WDC.

Step 2: Click Load Products

The user clicks Load Products. A wizard opens where the user can filter which products should be loaded into the stock counting lines.

Typical filters may include:

  • Warehouse
  • Category
  • Brand
  • Model
  • Branch
  • Other inventory-related filters available in the load product wizard

After clicking OK, the system loads those filtered products into the stock counting lines.

Code note: In stock_wdc, the inherited load product wizard automatically defaults the Warehouse from the stock counting document into the wizard.
[Attach Image Here] Load Products Wizard with Warehouse / Category / Brand / Model / Branch Filters
Load Products Wizard with Warehouse / Category / Brand / Model / Branch Filters

Step 3: Warehouse User Scans the Same Document in WDC

After the stock counting lines are already available in the document, the warehouse user goes to WDC, opens Stock Counting, scans the document number, and then starts scanning the physical products.

WDC again creates wdc.transaction.lines for the scanned products.

[Attach Image Here] Scan Preloaded Stock Counting Document in WDC
Scan Preloaded Stock Counting Document in WDC

Step 4: Confirm from Summary Page

Once scanning is completed, the user opens the Summary page and clicks Confirm.

This changes the scanned wdc.transaction.lines to Ready To Process.

[Attach Image Here] Summary Page Confirmation for Preloaded Count
Summary Page Confirmation for Preloaded Count

Step 5: Use Update Qty Instead of Import from WDC

Since the document already has stock counting lines, the user should click Update Qty instead of Import from WDC.

The Update Quantity wizard reads the WDC lines in Ready To Process or Processed state, groups them by product, warehouse, location, UoM, and lot, and updates the stock counting lines accordingly.

Actual behavior from code:

  • The custom option used is Update From WDC.
  • The wizard fetches WDC transaction data by matching the document number.
  • Any Ready To Process WDC lines are changed to Processed during this update step.
  • The stock counting lines are updated instead of creating new lines through import.
Important: If stock counting lines are already present, the system expects the user to use Update Qty, not Import from WDC.
[Attach Image Here] Update Qty from WDC in Stock Counting Form
Update Qty from WDC in Stock Counting Form

Step 6: Post the Stock Counting Journal

After the stock counting lines are updated with the scanned values, the back-office user verifies the quantities and posts the stock counting journal.

[Attach Image Here] Final Stock Counting Journal Ready to Post
Final Stock Counting Journal Ready to Post

4. What the Code Actually Does

For Specific Product Counting:

  • WDC scans create wdc.transaction.lines.
  • Summary confirmation changes them to Ready To Process.
  • Import from WDC loads those lines into stock counting lines only when the document has no existing lines.
  • After import, the WDC lines are marked Processed.

For Warehouse / Filter Based Counting:

  • The document is prepared from back office using Load Products.
  • WDC scanning still creates wdc.transaction.lines.
  • Summary confirmation changes them to Ready To Process.
  • Update Qty reads those WDC lines and updates the already existing stock counting lines.
  • During this process, Ready To Process lines are turned into Processed.

5. Important Notes

  • If the stock counting document already contains lines, Import from WDC is not allowed for counting.
  • For full warehouse or filtered counting, users should follow the Load Products → Scan in WDC → Confirm → Update Qty flow.
  • For selected product counting, users should follow the Create / Scan → Confirm → Import from WDC flow.
  • The stock counting form itself shows guidance messages telling users when to use Load Products, Import from WDC, or Update Qty.
  • The related WDC lines can be reviewed anytime through the WDC Lines link on the document.
Summary: In Stock Counting Via WDC, the first method is used for specific product counting and ends with Import from WDC. The second method is used for warehouse / filtered counting and ends with Update Qty after products are preloaded from the back office.