Skip to content

Custom Stock Count Add Documentation

Overview

The Custom Stock Count Add module (custom.stock.count.add) is a transient wizard identical to stock.count.mobile.add but registered for custom counting contexts. It provides a simplified interface for batch-adding count lines to stock counts with filtering and configuration options. This wizard is part of the custom counting workflow ecosystem.


Model Information

Model Name: custom.stock.count.add
Display Name: Custom Stock Count Add
Transient: ✅ Yes (temporary wizard data)

Features

  • Transient model - No permanent storage
  • Wizard interface - Simplified batch configuration
  • Multiple filters - Product, category, UOM, lot type
  • Quantity/price initialization - Configure defaults
  • Reusable pattern - Same as mobile.add

Key Fields Reference

Field Type Required Description
stock_count_id Many2One Target count for line addition
product_id Many2One Specific product filter
categ_id Many2One Product category filter
sale_invoice_uom_id Many2One UOM filter
lot_type Selection with_lot / without_lot
qty_type Selection previous / reset
price_type Selection previous / product / reset

For detailed field descriptions, see Stock Count Mobile Add Documentation.


API Methods

add_lines(ids, context)

Executes wizard to add filtered lines to stock count.

Example:

# Create wizard
wizard_id = get_model("custom.stock.count.add").create({
    "stock_count_id": count_id,
    "categ_id": category_id,
    "lot_type": "with_lot",
    "qty_type": "reset",
    "price_type": "product"
})

# Execute
result = get_model("custom.stock.count.add").add_lines([wizard_id])
# Returns navigation to count form


Common Use Cases

Use Case 1: Custom Count with Category Filter

# Add serialized items from specific category

wizard_id = get_model("custom.stock.count.add").create({
    "stock_count_id": count_id,
    "categ_id": electronics_categ_id,
    "lot_type": "with_lot",
    "qty_type": "previous",
    "price_type": "product"
})

get_model("custom.stock.count.add").add_lines([wizard_id])

Use Case 2: Blind Count Setup

# Setup for blind counting (zero start)

wizard_id = get_model("custom.stock.count.add").create({
    "stock_count_id": count_id,
    "qty_type": "reset",  # Start at zero
    "price_type": "product"
})

get_model("custom.stock.count.add").add_lines([wizard_id])

Best Practices

Same as stock.count.mobile.add:

  1. Use appropriate qty_type - reset for blind counts, previous for verification
  2. Filter appropriately - Don't add all products unnecessarily
  3. Execute immediately - Transient data expires after session

Model Relationship Description
stock.count Many2One Target count
product Many2One Product filter
product.categ Many2One Category filter
uom Many2One UOM filter

Version History

Last Updated: 2024-10-27
Model Version: custom_stock_count_add.py
Framework: Netforce


Additional Resources

  • Stock Count Mobile Add Documentation: stock.count.mobile.add (identical functionality)
  • Custom Stock Count Session Documentation: custom.stock.count.session
  • Stock Count Documentation: stock.count

This documentation is generated for developer onboarding and reference purposes.