Stock control and availability

eYssen ships a set of small, focused Stock modules that tighten up how on-hand quantities are guarded and reported: a hard stop on negative stock, a per-warehouse breakdown of on-hand, free and forecasted quantities that is precomputed for fast list, kanban and sale-order views, and a set of physical size and load attributes on storage locations. All four are optional and are switched on independently from the eYssen settings screen.

Preventing negative stock

By default Odoo allows a stock quant to go negative — useful for some workflows, but often a sign of a data-entry mistake or a missed reservation. The eyssen_stock_disallow_negative_stock module adds a hard validation guard: any stock move or adjustment that would leave a quant with a negative quantity in an internal or transit location is rejected outright, unless an explicit override has been switched on for that product, its product category, or the location itself.

The guard only applies to storable products of type Goods (type = 'consu' with is_storable set) — services and consumable-but-non-storable products are never checked.

Overrides

An Allow Negative Stock checkbox is added in three places, and any one of them being enabled is enough to allow negative stock for that combination:

  • the product’s Inventory tab (visible only for storable goods);

  • the product category’s Logistics group; and

  • the stock location’s form.

Allow Negative Stock checkbox on a storable product

If none of the three overrides is enabled and an operation would push the quantity below zero, Odoo blocks the operation with a validation error naming the product, its internal reference and the location.

Validation error raised when an operation would create negative stock

Note

The check only looks at internal and transit location usages. Customer, vendor, inventory-loss and production locations are not covered by this guard.

Per-warehouse stock data (Advanced Stock)

The eyssen_stock_advanced_stock module precomputes, per product variant, the on-hand, free and forecasted quantity in every warehouse that has been opted in, and stores the result in a dedicated product.stock.data model (one row per product/warehouse/quantity kind) instead of recalculating it on every page load. This keeps product list, kanban and sale-order views fast even on large catalogs, while still reflecting stock changes automatically.

Advanced Stock setting and Recompute All button

Per-warehouse opt-in

Stock data is only computed for warehouses that are explicitly enabled. On each warehouse’s Warehouse Configuration tab, a Stock group exposes two switches:

  • Calculate WH Stock on Product — turns on the per-warehouse computation for that warehouse; and

  • Visible WH Stock on Product — additionally exposes that warehouse’s figures as dynamic optional columns and search filters on the product list and search views (only available once calculation is enabled).

Warehouse Configuration tab with the Stock group and Update All button

Toggling either switch creates or removes, per warehouse, three read-only technical fields on both product.template and product.productx_eyssen_wh_pt_<warehouse_id>_onhand / _free / _forecasted (and the _pp_ equivalents on the variant) — and regenerates the supporting list/search view extensions that expose them as optional columns and as <quantity kind> in <Warehouse> search filters. Because changing the configuration does not retroactively fill these fields, a red warning banner appears on the warehouse form until the Update All button is used to recompute everything.

Viewing the data

On the product form, a read-only Stock Data widget on the General Information tab lists on-hand, free and forecasted quantities for every enabled warehouse, with a small refresh button next to it to force an immediate recompute for that product. The same widget is shown in the product kanban and list views (as an optional column).

Stock Data widget on the product form Product list with per-warehouse optional columns enabled

On a sale order, opening a confirmed line’s Qty at Date popover shows an extra All Warehouses table with the same on-hand/free/forecasted breakdown, in addition to the line-level stock widget.

Qty at Date popover extended with the All Warehouses breakdown

Automatic recomputation

The precomputed figures are kept in sync automatically whenever stock changes:

  • a stock quant is created, or its quantity or reserved quantity changes;

  • a stock move is confirmed, cancelled, or has its demand quantity or source/destination location edited (this also catches quantity shifts that move no quant, such as a reservation at a zero-stock warehouse); and

  • a purchase order is confirmed or cancelled.

All of these funnel into a single per-transaction “dirty set” of affected product templates, so several triggers on the same product within one transaction collapse into one recompute. By default the recompute runs right after the transaction commits, in its own database cursor, so a recompute failure never turns an otherwise successful operation into an error — it is logged and self-heals on the next stock change.

Tip

Enabling Use Background Jobs (queue_job) in the settings moves that same per-template recompute into asynchronous queue_job jobs instead, which helps avoid UI timeouts on large stock pickings. It requires the queue_job module to be installed first — the setting refuses to save otherwise.

Full recompute

Besides the automatic incremental updates, the data can be rebuilt for every storable product at once with the Recompute All button in the settings, or with a warehouse’s own Update All button (which delegates to the same full recompute). Use this after bulk data changes, or whenever the warning banner asks for it.

Legacy warehouse stock calculation

eyssen_stock_calculate_wh_stock is the earlier implementation of the same idea: the same Calculate WH Stock on Product / Visible WH Stock on Product switches on the warehouse form, the same dynamic per-warehouse x_eyssen_wh_pt_* / x_eyssen_wh_pp_* fields and optional list columns, and the same Update All / Recompute All actions — but it stores the computed figures directly on the product as a stored JSON field (product_wh_stocks) plus a stored HTML summary (product_wh_stocks_html) shown with a plain HTML widget, rather than in the searchable product.stock.data model. Recomputation on stock quant changes and purchase order confirm/cancel is per-product and runs in a fresh cursor after each transaction, without the shared dirty-set batching or the background-job option that eyssen_stock_advanced_stock offers.

Important

eyssen_stock_calculate_wh_stock and eyssen_stock_advanced_stock manage the same dynamically generated per-warehouse field names and the same named list/search view extensions. Only one of the two should be installed on a given database — installing both leads to the two modules overwriting each other’s generated fields and views.

Storage location size and load

eyssen_stock_load adds physical size and load attributes to stock locations, for tracking the usable dimensions and load capacity of a shelf, bin, or storage location. A Size & Load group is added to the stock location form (and the corresponding columns to the locations list view) with:

  • length, width and height/thickness fields, each expressed in a configurable length unit of measure (defaulting to the system’s reference length unit);

  • a Volume field with its own volume unit of measure; and

  • a Weight field with its own weight unit of measure.

Size and Load group on the stock location form

Note

The length/width/height fields ship with hard-coded Hungarian labels in the source code (Hosszúság (x), Szélesség (y), Magasság / Vastagság (z) — Length, Width, and Height/Thickness respectively) rather than translatable strings, so they display in Hungarian regardless of the interface language until a translation is added.

Important

The Volume field is not yet computed from the length/width/height dimensions — the underlying compute method is a stub that always stores 0. Treat it as a placeholder until this is implemented.

Configuration

Each module is switched on independently under Settings app ‣ eYssen ERP ‣ Stock:

  • Disallow Negative Stock — installs eyssen_stock_disallow_negative_stock;

  • Calculate Warehouse Stock — installs the legacy eyssen_stock_calculate_wh_stock;

  • Advanced Stock — installs eyssen_stock_advanced_stock; and

  • Size & Load Management — installs eyssen_stock_load.

Important

Only enable one of Calculate Warehouse Stock and Advanced Stock — see the warning above.

Once Advanced Stock is enabled, also enable Use Background Jobs (queue_job) (immediately below it in the settings) if the queue_job module is available and stock recomputation should not run inline with stock operations.

Usage

  1. Allow negative stock where it is legitimate. Before relying on the guard, review products, categories and locations that need an exception (for example a location used purely for corrective adjustments) and tick Allow Negative Stock on the appropriate record.

  2. Opt warehouses into per-warehouse stock data. On each warehouse that should report separate figures, tick Calculate WH Stock on Product, and additionally Visible WH Stock on Product if the per-warehouse breakdown should appear as optional list columns and search filters.

  3. Run a full recompute after opting in. Use the warehouse’s Update All button (or Recompute All in the settings) so the new warehouse’s figures are filled in immediately instead of waiting for the next stock movement.

  4. Check stock from the product or the sale order. Use the Stock Data widget on the product form, the optional per-warehouse list columns, or the extended Qty at Date popover on a sale order line to see on-hand, free and forecasted quantities per warehouse without leaving the record.

  5. Record location size and load on the locations that need it, so downstream reporting or putaway logic has length, width, height, and weight data to work with.

Scope and modules

  • eyssen_stock_disallow_negative_stock — blocks stock operations that would push a quant negative in internal/transit locations, with per-product, per-category and per-location overrides.

  • eyssen_stock_advanced_stock — current per-warehouse on-hand/free/forecasted computation, stored in the searchable product.stock.data model, with dynamic per-warehouse fields, product and sale-order-line widgets, and automatic/background recomputation.

  • eyssen_stock_calculate_wh_stock — earlier per-warehouse stock computation with the same warehouse-level switches, stored as JSON/HTML fields directly on the product; superseded by eyssen_stock_advanced_stock.

  • eyssen_stock_load — adds length/width/height, volume and weight attributes to stock locations.