Skip to main content

Automatically compute the safety stock for orderpoints

Project description

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 becomes your reorder threshold (the “min”). The “max” is set so your inventory will cover expected demand during the entire replenishment period.

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.

Understanding the Theory: Service Levels & Inventory Management

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)

How min and max are derived:

  • Minimum (min): safety stock + (average daily demand × lead time in days)

  • Maximum (max): min + (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.

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.

Table of contents

Configuration

General Settings > Inventory

  • Demand History Days: Define the rolling window for the historical analysis to compute the average daily demand and resulting safety stock. Default: 365. Company-specific.

Orderpoint (per replenishment rule)

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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file odoo_addon_stock_orderpoint_safety_stock-19.0.1.0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for odoo_addon_stock_orderpoint_safety_stock-19.0.1.0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d85f3c0b906c0bde0416a128e306c52c30264b52183ebe93c7fca88b4b45da6c
MD5 195a19658f96be7b04f43b25c72f8633
BLAKE2b-256 b8fe1a948502036a808a8d9e12727cca08fb74881985f6d38776ad13b92dd048

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page