Skip to main content
Odoo Community Association

Stock Removal Zone-Level FIFO

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

The standard FIFO removal strategy sorts the quants by incoming date (in_date). That date is set when the goods are received and follows them from location to location, so it cannot tell when they arrived in the zone they are stored in: a pallet received long ago and only now brought down to a picking area keeps its old incoming date, and the picker is sent to it before the stock that has been sitting in that area for weeks.

This module adds a Zone-Level FIFO removal strategy. It keeps the FIFO principle but sorts on a new Zone Entry Date (zone_in_date) field on the quant, falling back on the incoming date:

zone_in_date, in_date, id

zone_in_date changes only when the goods enter another zone, unlike in_date which a merge of stock or an inventory adjustment can move. A zone is the nearest ancestor location carrying the strategy. It is always set, so the sort above needs no NULL handling.

Table of contents

Usage

Set Zone-Level FIFO as the removal strategy of the parent location of each picking zone. That location is the zone: every location under it belongs to it, up to the next descendant carrying the strategy.

Do not set a removal strategy on the locations inside a zone: the nearest one carrying it wins, so such a location would become a zone of its own.

Setting the strategy on a product category only chooses how the quants are sorted, it never defines a zone. A category-level Zone-Level FIFO is therefore pointless on its own: without the strategy on at least one location, no zone exists, zone_in_date is never updated and the sort falls back on in_date. Use the category to apply the strategy warehouse-wide, and the locations to draw the zones.

Goods moved to a location that is in no zone keep their zone entry date, since no zone sorts them there. Tick Update Zone Entry Date out of Zones in the Inventory settings to give them the move date instead.

Goods entering a zone from a location in no zone always get a fresh date: once out of every zone, nothing tells which zone they came from, so Zone A -> Packing -> Zone B must count as a change of zone.

Development

A zone is the nearest ancestor location, itself included, whose removal strategy is zone-based. stock.location._get_zone_location() resolves it, and _zone_removal_strategies() lists the strategy methods that define one — a module adding another zone-based strategy extends that list.

An extension module defining the zones differently overrides _get_zone_location on stock.location:

def _get_zone_location(self):
    return <the zone of this location> or super()._get_zone_location()

stock.location._is_same_zone(source_zone, destination_zone) decides what counts as staying put: True keeps the date of the goods, False updates it. A destination in no zone answers True, unless the company setting zone_in_date_update_out_of_zone is on. Override it to change that rule.

When the destination location already holds stock, the returned date competes with the one already stored and the oldest of the two wins, so arriving goods never push the ones already there back in the queue. This mirrors the way the core keeps the oldest in_date when it merges stock into an existing quant.

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

  • BCIM

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:

jbaudoux

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

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

Metadata

Release files for odoo-addon-stock-removal-zone-fifo 18.0.1.0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addon-stock-removal-zone-fifo 18.0.1.0.0.4
File Interpreter ABI Platform Actions
odoo_addon_stock_removal_zone_fifo-18.0.1.0.0.4-py3-none-any.whl Python 3 none any Details for odoo_addon_stock_removal_zone_fifo-18.0.1.0.0.4-py3-none-any.whl

Release files / odoo_addon_stock_removal_zone_fifo-18.0.1.0.0.4-py3-none-any.whl

Download URL odoo_addon_stock_removal_zone_fifo-18.0.1.0.0.4-py3-none-any.whl
Size 39.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e677abe41a90af6c1835f6c445a9d7493838a0fff783bd5ae0838a1066e0399
BLAKE2b-256 checksum
How to use checksums
73c3bf45cb2f8278458a9c89b199b892c936a247e15d1568e6cc31120ba217d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for odoo-addon-stock-removal-zone-fifo 18.0.1.0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page