Stock Removal Zone-Level FIFO
stock_removal_zone_fifo · OCA/stock-logistics-reservation
-
Security25/25No findings
-
Activity25/25Last human commit 1 month ago
-
Required by20/252 modules depend on it
-
Maturity5/25In 1 Odoo series since 18.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `ALTER TABLE stock_quant ADD COLUMN IF NOT EXISTS zone_in_date timestamp; UPDATE stock_quant SET zone_in_date = in_date WHERE zone_in_date IS NULL;` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
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.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 2
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
res_config_settings_view_form |
res.config.settings.form.zone.in.date | res.config.settings | form | Inherits stock.res_config_settings_view_form |
view_stock_quant_tree_editable |
stock.quant.list.editable.zone.in.date | stock.quant | list | Inherits stock.view_stock_quant_tree_editable |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 5
-
zone_in_date_update_out_of_zoneBooleanhelp='Update the zone entry date when goods are moved to a location that is in no zone. Off by default, as no zone-based removal strategy sorts them there.'string='Update Zone Entry Date out of Zones'
No public methods.
-
zone_in_date_update_out_of_zoneBooleanreadonly=Falserelated='company_id.zone_in_date_update_out_of_zone'
No public methods.
No new fields.
Public methods (0)No public methods.
No new fields.
Public methods (0)No public methods.
-
zone_in_dateDatetimedefault=fields.Datetime.nowhelp='Date at which these goods entered the storage zone they are stored in.\nIt differs from the incoming date on two points: it is not reset when stock is merged into the quant, and it is kept when the goods are moved between two locations of the same zone.'index=Truereadonly=Truerequired=Truestring='Zone Entry Date'
-
create(self, vals_list)@api.model_create_multi