What challenge was the customer facing?
The retailer needed Odoo to decide when and how much to reorder for every product, because minimum and maximum quantities set by hand could not keep up with changing sales and uneven suppliers.
The business sells through a Shopify store and runs sales, stock and purchasing in Odoo. Buyers set a minimum and a maximum quantity for each product, which meant checking stock and recent sales product by product. That is hard to keep right when a product suddenly starts selling faster, or when a supplier is slow to deliver.
Suppliers did not behave alike. Some delivered late or sent less than was ordered, so the same stock rule gave very different protection depending on who supplied the product. New products had too little sales history for a sales forecast to be trusted, while the business already tracked product recommendations and stock alerts in its Metabase reports. Products marked as on demand needed a person to start a purchase order once enough alerts had come in.
A first version of the module, built earlier, set the minimum and maximum quantities from average sales over a chosen number of days. It ran on a daily schedule for products that were published and marked Keep selling and buying, and it relied on averages and nothing else. The buying team also wanted every product checked on every run and nothing confirmed automatically, so people stayed in control of what was actually ordered. The module had to move with the database from Odoo 16 to Odoo 18 as well.
What did the business need to achieve?
The goal was reordering rules that react to real demand and real supplier behavior, with people reviewing the purchase orders. The team asked for:
- reorder timing based on each supplier's real lead time and reliability, so slower or less dependable suppliers are ordered from earlier
- top-selling products protected from stockouts, with the next tier given a modest boost
- recommendations included, so products about to surge are ordered before they run out
- a draft starter order for On Demand products that pass an alert threshold, with nothing confirmed automatically
- slow movers that still have stock left alone
- key settings that the team can change without a deployment
- an optional free-shipping top-up, kept separate for a second phase
How did TeqStars help?
TeqStars extended the retailer's Auto Update Reordering Rules module in stages. The existing forecast and the daily scheduled run stayed in place, and new calculations were added around them, each with a setting to switch it off. The run writes minimum and maximum quantities for every product and drafts purchase orders for review, never confirming one.
- An ARIMA forecast of daily sales over a configurable number of days, 60 by default, so products that have started to sell more are picked up before their averages catch up.
- Each supplier's real lead time: the median days between approving and receiving its purchase orders over the last year, with a default when there is no history.
- A reliability rating for every supplier, reliable, medium or erratic, from how much it delivered, how late it was and how much its lead times varied. Less reliable suppliers get an earlier reorder point.
- Top sellers ranked by quantity sold over the last 90 days. By default the top 200 get extra safety days on top of the lead time, with supplier reliability applied, and ranks up to 250 get a 15% boost.
- Product recommendations sent over the last 30 days and active stock alerts, read per SKU from the customer's Metabase reports and converted into expected daily demand. Products with fewer than 10 days of sales rely on this signal instead of the forecast.
- A draft starter purchase order line for On Demand products with at least 3 active alerts, sized to the larger of the supplier's minimum order quantity and the alert count, and never added twice to an open draft.
- Guards for the edges: a product that sells almost nothing but still has stock stays at its baseline, and a product that is out of stock but still selling is always restocked.
- Every threshold on the reordering rule template form, so the team changes factors, coverage days and rank cutoffs without a deployment, and a master switch restores the original behavior.
- A dry-run mode that writes nothing and attaches a comparison file with the current and proposed minimum and maximum for each product, ready for a spreadsheet review.
- A separate scheduled job that tops up a draft purchase order just below a supplier's free-shipping level with products of the same supplier that are about to need a reorder.
The work started from the customer's written requirements. TeqStars analyzed them, answered the buying team's questions, and agreed that every product is checked on every run: skipping only ever means that no order is raised, never that a product goes unchecked. The new logic was built and tested on a staging copy, first in dry-run with the comparison file, then with real draft purchase orders.
Testing covered file generation, the rules written to products and both scheduled jobs. An error raised by a field the customer had added with Odoo Studio was reproduced in a local copy and fixed. The buying team then reviewed real drafts and reported excess products in a request for quotation, products marked to stop buying, high forecast quantities and different arrival dates on one order. TeqStars separated the custom logic from standard Odoo, explained how the forecast drives quantities, and made three changes. Products marked To Kill or Stop Buying stay out of automatic drafts but can still be added by hand. All lines on one purchase order share one expected arrival date. A product joins its supplier's open draft even when the buyer differs.
After the staging branch was merged, TeqStars set the production parameters, configured the free-shipping job and checked the products on the draft purchase orders.
Key capabilities delivered
- Business Process Automation
- Inventory Automation
- Custom Development
- API Integration
Challenges we solved
- Minimum and maximum quantities set by hand
- Products that start selling faster than averages show
- Slow or unreliable suppliers delivering later than planned
- New products with too little sales history
- On Demand products needing a starter purchase order
- Orders just below a supplier's free-shipping level
- Products to stop buying entering draft orders
- One purchase order with different arrival dates
What business processes improved?
Before
Buyers checked stock and recent sales themselves and typed a minimum and a maximum quantity for each product. Every product was treated alike, whether its supplier was punctual or slow, and keeping the numbers right when a product suddenly sold more meant checking it again by hand.
After
A daily run recalculates the minimum and maximum quantities for every product from forecast demand, the supplier's real lead time and reliability, the product's sales rank and its recommendation signal. Draft purchase orders appear for review, and the buying team confirms them.
What results did the project achieve?
The retailer's reordering rules now recalculate on their own every day. Every product is evaluated on every run, so nothing falls outside the calculation, and the buying team reviews draft purchase orders and confirms the ones it wants.
Suppliers that deliver late or short are ordered from earlier, top sellers carry extra protection, and products with a rising recommendation signal or a growing sales trend are reordered before their averages show it. On Demand products wait as draft starter lines instead of being ordered automatically, and a product that is out of stock but still selling is always restocked.
The team can change any threshold on the template form, test a change in dry-run first, and switch the new logic off with one setting. The feedback from real draft purchase orders shaped the later changes: products to stop buying stay out of automatic drafts, each purchase order has one expected arrival date, and products for a supplier join its open draft.
Customer success story