Odoo Community Association

Stock Orderpoint Safety Stock

Beta License: AGPL-3 OCA/stock-logistics-orderpoint Translate me on Weblate Try me on Runboat

This module enhances inventory management by introducing service-level–based, stochastic control using a continuous review replenishment system. Instead of relying solely on fixed min/max stock levels, the module estimates your typical (mean) and variable (variance) daily demand from historical data and factors in lead time. These calculations generate a statistically sound safety stock, which is included in your reorder threshold (the “min”). The “max” is set so your inventory will cover expected demand during the entire replenishment cycle.

Now, you can set replenishment rules (orderpoints) based on the Cycle Service Level (CSL), which reflects the probability of meeting all demand during a replenishment cycle without running out of stock. This provides a practical alternative to manually setting minimum and maximum stock thresholds.

With CSL enabled, safety stock is automatically calculated using your historical daily sales data (both average and standard deviation), gathered over a period you define, plus the orderpoint’s lead time. The system then keeps your reordering rule’s min and max levels up-to-date.

Prefer manual control? You can always switch back to the “Manual” mode to specify min and max directly.

Theory

The backbone of this approach is the Cycle Service Level (CSL), a widely used supply chain metric:

  • CSL Definition: The chance that your inventory will fully cover demand during a restocking cycle.
  • Example: A CSL of 95% means that only 5% of cycles will risk a stockout.

This system assumes demand is random (not fixed), so it uses statistical methods:

  • Average daily demand (μ)
  • Standard deviation of daily demand (σ)

Because demand can fluctuate during the lead time, safety stock acts as a buffer to reduce the risk of running out of stock.

Safety stock formula:

safety_stock = σ_L × z × g

Where:

  • σ_L: Standard deviation of demand over the lead time
  • z: Z-score for your desired CSL (e.g., 1.65 for 95% CSL)
  • g: Growth factor (optional, lets you add a margin)

Three zones are needed to define how min and max are derived:

  • Red zone = safety stock:
    • This zone should never be touched. It acts as the buffer for unexpected variation.
    • Refer to the safety stock formula above.
  • Yellow zone = expected demand during the lead time:
    • This zone represents the expected stock consumption from the moment you click on replenish, until the moment you receive your purchase order.
    • Formula: average daily demand × lead time in days
  • Green zone = expected demand during the cycle:
    • Represents the stock consumption during the desired reordering cycle (the time between two replenishments)
    • Formula: average daily demand × cycle days

Where:

  • lead time: The time it takes to receive the order.
  • cycle days: The desired number of days between orders.

From these three zones, the min and max quantities are derived as follows:

  • Minimum (min): Red + Yellow
  • Maximum (max): Red + Yellow + Green

Why does it work?

  • Odoo triggers replenishment whenever stock falls below the min, which should be enough to cover variance (safety stock) and lead time demand.
  • The max level is set high enough to cover all expected demand until the next restock, plus a buffer to cover the desired cycle days.

This makes inventory management both more data-driven and easier to maintain.

cycle-graph

Table of contents

Configuration

To efficiently use this module, some configuration must be done in Odoo.

Demand History Days

In the General Settings >Inventory, under Advanced Scheduling, you have the possibility to set the Demand History Days.

It defines the rolling window for the historical analysis to compute the average daily demand and resulting safety stock. Defaults to 365. Company-specific.

demand_history_days

Cycle Service Levels

They define the target probability of meeting all demand during a replenishment cycle without running out of stock. The module comes with predefined values for Cycle Service Levels and their z-scores, but you can create more according to your needs.

cycle_service_levels

Usage

Set up your Replenishment Rules (Orderpoints) to use the Cycle Service Level method, and play with the following variables to fit your needs. The module will recompute daily the Min, Max and thus the To order quantities based on the historical demand data and the parameters you set.

Reordering Rule Parameters

Safety Stock Method

  • Manual: The product’s min and max quantities are set manually (standard Odoo behavior).
  • Cycle Service Level: The product’s min and max quantities are computed based on the target cycle service level, growth factor, order cycle and lead times.

Cycle Service Level

Defines the target probability of meeting all demand during a replenishment cycle without running out of stock. Typical values range from 90% to 99%. A higher target increases safety stock to reduce the risk of stockouts; a lower target reduces inventory at the cost of more frequent shortages.

Cycle Days

The desired number of days between orders. Used to size the gap between the min and max quantities, to cover the expected demand during the desired reordering cycle.

Growth Factor

An optional multiplier to account for expected growth in demand. Will be applied to the safety stock and the resulting min and max quantities.

Additional information

This module enhances the transparency of inventory management by displaying the full calculation path for minimum and maximum stock levels. By providing visibility into how safety stock formulas are derived directly within the user interface, it builds user trust and simplifies the verification of automated procurement rules.

When clicking on the ℹ️ icon, you are redirected to all the necessary info & configuration needed to use this OCA module:

orderpoint-tree-info

orderpoint-additional-info

Note: Some fields are only shown in “Developer Mode”.

Min & Max computation

All the statistics and safety stock are non-stored fields computed on-the-fly, while min & max quantities are computed either:

  • Manually by clicking on the replenishment’s 🔄 button

    orderpoint-refresh-manual

  • Automatically by a daily scheduled action

    orderpoint-refresh-cron

Usability filters

It’s possible to filter on the safety stock method & on the cycle service level in the Orderpoint tree view:

orderpoint-filters

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Camptocamp

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

ivantodorovich

This module is part of the OCA/stock-logistics-orderpoint project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.