AI Inventory Forecasting in Distribution: Lessons from the Field
Stockouts on best-sellers, overstock on the long tail: how we run an AI inventory forecasting project for a distributor, from cleaning Odoo history to the weekly review with the buyer.
By Sudo System Team
Data, AI & Supply Chain Practice
We have met plenty of buyers who spend their Monday mornings juggling a spreadsheet, the Odoo Inventory screen and chasing calls from sales reps. The picture is almost always the same: the best-selling items run out at the worst possible moment, while entire shelves of slow movers tie up cash. Here is how we run this kind of project for a distributor, step by step, including what works and what doesn't.
The starting point: stockouts and overstock are one and the same problem
Take a typical example of what we see: a Casablanca-based distributor of spare parts and fast-moving consumer goods, with around 3,000 active SKUs, two warehouses and some thirty suppliers, a few of them importing with lead times of six to ten weeks. Odoo has been running for three years across sales, purchasing and inventory. Reordering rules exist, but their minimums and maximums were entered at go-live and have barely been touched since.
The result: among the 200 or 300 items that generate most of the revenue, stockouts keep happening. Meanwhile, on the long tail, hundreds of SKUs have been gathering dust for months. The classic mistake is to treat these two symptoms separately. In reality they share one cause: a uniform stock policy applied to items that behave in completely different ways.
Step 1: clean the history before forecasting anything
A forecasting model learns from the past. If the past recorded in Odoo is wrong, the forecast will be wrong too, with all the confidence of a computer-generated number. So we systematically spend the first weeks on sales history and stock movements.
What we look for: duplicate products (the same part created three times under different names), one-off sales that distort the average (a single tender, a large customer stocking up ahead of a price increase), badly recorded returns and changes in unit of measure.
Past stockouts deserve special attention. When an item is unavailable for three weeks, the history shows zero sales. A naive model concludes that demand is falling and recommends ordering less: the perfect vicious circle. These periods must be identified from past stock levels and treated as missing data, not as zero sales.
Step 2: segment your SKUs with an ABC/XYZ matrix
Not every SKU deserves the same attention or the same model. ABC segmentation ranks items by their weight in revenue or margin: A for the few items that carry the business, C for the long tail. XYZ segmentation measures demand regularity: X for items that sell steadily, Z for those with erratic or sporadic sales.

Crossing the two gives nine cells, and each one calls for a different stock policy. Here is the grid we use as a starting point, to be adjusted with the buyer according to the business and available cash.
| Segment | Profile | Stock policy | Forecasting method |
|---|---|---|---|
| AX | High revenue, steady demand | Moderate safety stock, frequent replenishment, close monitoring | Statistical model with seasonality |
| AY | High revenue, variable demand | Higher safety stock, weekly review | Seasonal model adjusted by the buyer |
| AZ | High revenue, erratic demand | Case-by-case sizing, early customer orders | Buyer judgement and sales intelligence |
| BX / BY | Medium revenue | Odoo min/max rules recalculated automatically | Exponential smoothing or weighted moving average |
| CX / CY | Low revenue, fairly regular demand | Minimal stock, economic order quantities | Simple average |
| BZ / CZ | Sporadic demand | Little or no stock, buy to order, range review | No detailed forecast |
Step 3: a simple model before a sophisticated one
This is probably the advice we repeat most often. Before talking about neural networks, we set up a simple baseline: moving average, exponential smoothing, perhaps a classic seasonal model. Then we measure its error over recent months, SKU by SKU. Only after that do we test more advanced models, such as gradient boosting, which can take in external variables like promotions, prices or the calendar.
Why the caution? Because for a large share of SKUs, the simple model performs almost as well as the complex one while being far easier to explain. And a buyer who doesn't understand where a number comes from will end up ignoring it.
Moroccan seasonality is a topic in its own right
Standard forecasting libraries know about Christmas and weekends. They know nothing about Ramadan, which moves about eleven days earlier each year in the Gregorian calendar. Yet for an FMCG distributor it is the main peak, preceded by rising orders several weeks ahead. The Ramadan that has just ended proved it again: history aligned on calendar months compares periods that have nothing in common.
So we build an event calendar specific to each client: Ramadan and Eid al-Fitr, Eid al-Adha, back-to-school, summer with the return of Moroccans living abroad, and the year-end closings of certain business customers. Each event becomes a variable the model can learn from. For spare parts, seasonality is often different (air conditioning in summer, batteries in winter), which is why we reason by product family.
Step 4: connect the forecast to Odoo and to the buyer
The forecast has to feed the tools the purchasing team already uses. In Odoo, that means reordering rules: every week, an automated job recalculates each item's minimum and maximum from forecast demand over the supplier lead time, the safety stock tied to its segment and lot-size constraints. The buyer keeps the same tool; it's the parameters that get smarter.
The weekly review, where everything is decided
We set up a short ritual, thirty to forty-five minutes a week, between the buyer, a sales rep and whoever looks after the model. The group reviews large gaps between forecast and reality, A items at risk of stockout, and information the model cannot know: a customer announcing a big project, a supplier warning of a delay at the port.
"At first, the buyer corrected almost every proposal. After two months, he only touched AZ items and new products. The model hadn't changed; trust had. Week after week, he had seen when the machine was right and when it was wrong."
— A consultant from our Data, AI & Supply Chain practice
The mistakes we see most often
The first is trying to forecast everything. Forecasting 3,000 SKUs in detail, a good share of which sell fewer than five times a year, is a waste of time: for CZ items, the right decision is often to stop stocking them. The second is judging the project on a single global error metric. A flattering average error can hide poor results on A items, the ones that really matter. We track service level by segment and the value of tied-up stock instead.
The third mistake is ignoring real supplier lead times. The lead time entered on the Odoo vendor record is often optimistic; we recalculate it from actual receipts, including its variability. Finally, the most human one: launching the project without the buyer. If they discover the forecast once the model is finished, they will see it as a verdict on their work. Involved from the data-cleaning stage, they become the project's best ally.
What to expect, and where to start
Let's stay cautious with numbers, because everything depends on the starting point. In projects of this kind, the orders of magnitude we observe are a noticeable drop in stockouts on A items, often by a third to a half, and a reduction in stock value ranging from a few points to around fifteen percent, mostly achieved by cleaning up the long tail. These gains typically show up after two or three replenishment cycles, not in the first week.
Key takeaway — The gains from a forecasting project rarely come from the most advanced model. They come from clean history, a segmentation that differentiates stock policies, Odoo rules recalculated automatically, and a weekly review where the buyer has the final say.
Export two years of sales per item from Odoo, rank them ABC by revenue, and count how many of your A items had at least one stockout last quarter. This one-day exercise will tell you whether the problem is costly enough to justify a structured approach. If it is, the Sudo System team can support you from data cleanup all the way to production in Odoo.