Skip to main content
Odoo 20 FEFO: Pick the Right Lot Before It Expires
12 min read
Odoo

Odoo 20 FEFO: Pick the Right Lot Before It Expires

How Odoo 20 FEFO picks lots by removal date: expiry, best-before, removal and alert dates, category vs location precedence, and tests before go-live.

A warehouse can have the right product and the right quantity but still ship the wrong batch. For food, cosmetics, healthcare supplies, and other date-sensitive goods, the question is not simply what is in stock? It is which lot should leave first, and is that lot still acceptable to deliver?

In Odoo 20, First Expired, First Out (FEFO) is a stock-removal strategy that prioritizes tracked lots by their removal dates. To make it work, enable lot or serial tracking, configure expiration information, apply FEFO to the relevant storage location or product category, and test the reservations on actual delivery operations. A date on a product label or a successful barcode scan is not, by itself, proof that the correct lot was allocated.

This is a guide to making FEFO predictable in production: what each date means, how the strategy chooses stock, why unexpected lots appear, and where a stricter quality or compliance process must take over. The configuration is documented in Odoo's 20.0 FEFO removal guide and expiration-date guide.

FEFO is not FIFO, and neither is an expiry hold

FIFO (First In, First Out) prioritizes stock based on when it arrived. FEFO (First Expired, First Out) prioritizes stock based on the configured removal dates associated with expiration information. The oldest box is not always the box that expires soonest: suppliers may deliver products with different production dates or remaining shelf lives. Odoo documents these as distinct inventory removal strategies in its FIFO guide and FEFO guide.

The distinction matters operationally. Suppose Lot B arrived yesterday but expires next week, while Lot A arrived last month but expires in two months. FIFO may favor Lot A. FEFO should favor Lot B, provided the lots, dates, locations, quantities, and removal-strategy configuration support that choice.

But FEFO is a picking preference, not a complete quarantine, recall, or customer-specific minimum-shelf-life policy. If the business needs an absolute rule that a lot may never be dispatched after a defined threshold, that rule must be proven separately in the actual operation. Do not assume that an expiry warning automatically creates the hold your business requires. Odoo 20 does add two native safeguards: automatic reservation skips lots whose removal date falls before the transfer's scheduled date, and validating a transfer that contains an expired lot, or one past its removal date, asks the user to confirm. Both help, but a user can still confirm the transfer, so neither is a hard hold.

Know the four dates before changing the configuration

Odoo 20's expiration-date settings distinguish four concepts for lot- or serial-tracked goods. They are easy to confuse because three of them are counted back from the expiration date, which itself is counted forward from receipt.

DateOperational meaning
Expiration DateWhen the lot reaches its configured expiry; the product's expiration interval is used to calculate the date for received or manufactured goods.
Best Before DateAn earlier quality-related point, not necessarily the point at which the goods become unsafe.
Removal DateThe point before expiry at which goods should be removed from stock; FEFO uses the assigned removal dates for selection priority.
Alert DateThe point used to flag a lot approaching expiry so the responsible team can investigate.

The official Odoo 20 expiration-date reference explains these fields and how they can be populated on incoming or manufactured items. Product defaults are useful, but they are not a substitute for verifying supplier-provided batch dates. Where actual dates differ, ensure the lot record reflects the verified dates rather than blindly accepting a generic shelf-life calculation.

A business policy might say: identify a short-dated batch 20 days before expiration, stop normal customer allocation 10 days before expiration, and remove expired units for an authorized disposition. These are three different actions. The first is monitoring, the second is an allocation rule, and the third may involve inspection, quarantine, return, or scrap. Map each action to a confirmed Odoo workflow rather than treating the four date fields as a single compliance switch.

Configure FEFO in Odoo 20

1. Enable traceability and set product tracking

Go to Inventory → Configuration → Settings and enable Lots & Serial Numbers in the Traceability section. Then enable Expiration Dates. On each relevant product, choose the appropriate Tracking option—typically By Lots for batches, or By Unique Serial Number for individually tracked products. The Odoo 20 product-tracking guide explains the difference.

If the product already has untracked on-hand inventory, do not assume changing the switch retroactively supplies correct batch identities. Reconcile the physical stock, label it, and use the appropriate supported inventory adjustment process before going live. For a warehouse with historical anonymous stock, that data-cleanup step can be more important than the FEFO setting itself.

2. Define and verify product and lot dates

On the product's Inventory tab, enable expiration tracking and configure the relevant date intervals. Receive a small test quantity into a staging database, assigning the appropriate lot number and checking the generated dates against the supplier's certificate, label, or approved master data.

Use two lots with different expiry dates. Verify not only that the dates appear, but that the lot records point to the correct physical batch. Odoo's expiration-date instructions cover assigning dates during receipts and viewing expiration information in the lot/serial-number area.

Do not treat a manufacturing date, best-before date, and expiration date as interchangeable inputs. If the supplier or regulated product category defines shelf life differently, reconcile the source data and configure the fields accordingly.

3. Apply FEFO at the intended location or product category

Configure the removal strategy on the storage location or on the relevant product category. In Odoo 20, a category's Force Removal Strategy takes priority when it conflicts with a strategy on the location. That precedence is a frequent reason for a warehouse appearing to ignore its location-level FEFO setting. See Odoo 20 FEFO removal.

The configuration should follow the stock, not just the product name. A company may keep date-sensitive goods in several internal locations, return areas, or warehouses. Confirm the source location of the delivery operation and verify that the applicable rule is FEFO there. If you use a forced category strategy, document why it is applied across every location for that category.

4. Test the reservation on a real delivery flow

Create a test sales order containing enough units to draw from more than one lot. Confirm it and inspect the generated delivery's detailed operations or lot allocation. Compare the suggested lots with their removal dates, then validate the actual operator workflow on the devices used in the warehouse.

A correct screen selection is not enough. Check the final recorded lot numbers and quantities, and verify that another operator, a scanner input, or a manual adjustment did not change the lot before validation. Octivex's separate Odoo 20 Barcode guide covers scanner identifiers, GS1, and validation boundaries; FEFO is the additional inventory rule that decides which eligible batch should be picked.

A worked example: two lots, one customer order

Consider an illustrative warehouse on November 1 with a product tracked by lot. For demonstration, suppose the removal policy is 10 days before expiry.

LotQuantity on handExpiration dateRemoval date
FOOD-A3 cartonsNovember 12November 2
FOOD-B8 cartonsNovember 19November 9

The customer orders 5 cartons. Under FEFO, assuming both lots are otherwise available and the operation is correctly configured, the expected allocation is 3 cartons from FOOD-A and 2 from FOOD-B. This is the same selection principle shown in Odoo's official FEFO workflow example: exhaust the earlier removal-date lot first, then use the next one.

That is not necessarily permission to ship FOOD-A. If the customer's agreement requires at least 15 days of remaining shelf life on delivery, FOOD-A should fail that additional business rule. FEFO alone solves prioritization; a customer-specific minimum-remaining-life rule solves eligibility. Keep the difference visible in the implementation and its tests.

A further caution: the example assumes quantity is unreserved and in a pickable location. If FOOD-A is already reserved elsewhere, or its three cartons are physically in quarantine, the allocation may legitimately differ. Investigate those facts before calling the strategy broken. Dates matter too: Odoo 20 does not automatically reserve a lot whose removal date is earlier than the delivery's scheduled date, so if this delivery were scheduled for November 3, FOOD-A (removal date November 2) would be skipped and all 5 cartons would come from FOOD-B.

Why Odoo picks an unexpected lot

The product category overrides the warehouse location

Open the product category and inspect Force Removal Strategy before changing warehouse routes. A category rule can override the location preference. Test again after a controlled staging change, and record the intended precedence for the warehouse team.

The lot is missing a usable removal date

An item that is not tracked by lot, has an incorrect lot assignment, or carries an unexpected expiration date cannot support reliable FEFO selection. Trace the receipt back to the product, lot, expiry values, and detailed move lines. Fix the source data and retest; do not guess that the physical box and Odoo lot are the same.

The stock cannot actually be picked

A lot may appear in an on-hand view but be reserved for another order, stored in a different location, or associated with a stock operation the worker is not processing. Check available quantities, source locations, and existing reservations before comparing FEFO order. The lot-tracking and inventory documents explain how Odoo maintains stock traceability: Product tracking.

A human or connected application changes the selection

Manual batch substitution, an import, or a custom mobile process can affect the intended move. If operators scan a physical lot that differs from the reserved one, the process needs a controlled exception path. A scanner success tone is not proof of an approved delivery, and a custom API must not bypass Odoo's normal permissions and validation.

The expiry alert exists, but no hold workflow does

Odoo documents expiration alerts and a way to review expiring lots. That is not equivalent to a verified hard prohibition on selling every affected unit, for every operation and user role. Define what happens when a lot is near expiry: quality review, removal from pickable stock, return to supplier, approved discounted sale, or disposal. Implement only the controls needed, then demonstrate them end to end.

Expiry alerts, quarantine, and recalls are separate controls

A production-ready process should distinguish awareness, allocation, and authority:

  • Awareness: Staff can see the alert date, expiry status, and responsibility for an expiring batch. Odoo 20 documents viewing expiration alerts in the Lots/Serial Numbers area and notifying a product's responsible user in specified circumstances.
  • Allocation: FEFO chooses the earlier applicable removal-date lot among stock eligible for the operation.
  • Authority: A documented role or controlled rule decides whether a short-dated, expired, recalled, damaged, or quarantined lot may leave the warehouse at all.

Do not automatically scrap stock merely because a warning appears. Whether an item is dangerous, saleable, returnable, or eligible for an exception depends on the product, customer contract, validated shelf-life data, and applicable requirements. The operational design needs an approval and disposition trail if those decisions matter to the business.

For more complex workflows, begin by assessing native Inventory and Quality configuration. Only introduce a custom module, approval action, or scanner restriction when a test demonstrates that the required behavior cannot be delivered and maintained safely with the standard process. Additional software should enforce the business decision, not duplicate the inventory ledger.

An acceptance-test matrix for a real warehouse

Before changing a production database, run the following scenarios in a staging copy using representative products, locations, operator permissions, and actual scanning hardware. These are proposed tests, not claims that a particular system has already passed.

ScenarioOutcome to verify
Two eligible lots have different removal datesThe earlier removal-date lot is proposed first under FEFO.
Customer order exceeds the first lot's available quantityAllocation splits into the next eligible lot with exact quantities.
Product category specifies FIFO while location specifies FEFOActual precedence matches the category's forced strategy.
A lot is missing or has an incorrect expiration dateThe problem is detected through a defined receiving or inspection check.
Earliest-expiring lot is reserved for another orderAllocation respects current stock availability and reservations.
Operator scans a lot other than the reserved lotApproved exception path or rejection; no silent substitution.
Lot is expired, recalled, or on a controlled holdThe site's separately configured eligibility restriction is proven to work.
Customer demands minimum remaining shelf lifeAn explicit policy check rejects inadequate shelf life regardless of FEFO order.
A lot is split across two physical locationsThe intended source location and quantities appear on the validated transfer.
A receipt or delivery is interrupted and retriedNo duplicated posted movement; audit trail and quantities reconcile.

For each test, inspect the actual Odoo stock move and lot traceability after validation. A screenshot of the suggested selection is weaker evidence than the final stock record. Where quality holds or customer shelf-life rules are custom-built, test unauthorized API attempts too, not only the normal UI.

When does FEFO require customization?

Use native FEFO first for straightforward batch rotation where dates and lot identities are reliable, categories and locations are correctly configured, and the warehouse can work within standard Odoo picking operations.

Customization can be justified when the business needs, for example, distinct minimum shelf-life thresholds by customer or destination, enforced quarantine across multiple operation types, carrier handover verification, specialized GS1/handheld flows, or integration with an external laboratory or quality system. Those are additional rules and workflow boundaries, not reasons to replace the entire inventory engine.

Keep Odoo's stock moves and lot identities authoritative. A separate Flutter warehouse interface or external integration should submit a business action that Odoo validates, not independently mark a lot as shipped. If the project has multiple warehouses, review transfers and replenishment alongside FEFO; our Odoo 20 inter-warehouse replenishment guide explains the route and stock availability side of that problem.

Make the next batch decision auditable

FEFO is useful precisely because it gives a repeatable allocation rule. But successful expiry-sensitive operations require more than choosing the earliest date: they require accurate lot data, explicit stock availability, controlled overrides, and tested restrictions for goods that should not ship.

Before writing a module, test the native Odoo 20 process against the worst realistic batch. If that reveals a genuine gap, define the smallest additional control and how it will be audited. If you need help configuring or extending inventory workflows, Octivex's Odoo engineering team can assess the stock flow and scope a practical implementation.