Stock Account Product Run FIFO Hook
stock_account_product_run_fifo_hook · OCA/stock-logistics-workflow
-
Security25/25No findings
-
Activity25/25Human commit this month
-
Required by5/250 modules depend on it
-
Maturity25/25In 8 Odoo series since 13.0
Heuristic over the facts below, not an audit · How it's computed
Description
This module adds hook points in the FIFO valuation process to add more flexibility in the information that is stored and processed during FIFO candidate calculations.
In Odoo 19, the valuation logic has shifted from stock.valuation.layer to stock.move.
This module provides extension points for custom modules to:
- Access FIFO candidate move information during valuation
- Know which outgoing move consumes each FIFO candidate
In Odoo 20, the per-quantity FIFO computation moved from _run_fifo() to
_get_fifo_value() (_run_fifo() now values whole products in batch), so the hook
is injected in _get_fifo_value(). Core no longer passes the outgoing move being
valued, so this module also patches stock.move._set_value() to put it in the
valued_move context key.
Odoo 20 also replays the FIFO valuation (_run_fifo(correction=True)) when a valued
move line quantity, location or lot is edited, a move date changes, a product value is
adjusted, the costing method changes, or a receipt fills stock that was already sold.
This module patches it to call the same hook for each candidate consumed during the
replay, and adds _run_fifo_correction_reset() before it so that custom modules can
drop the data stored for the outgoing moves that are replayed.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 0
No views found for this module.
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 1
No new fields.
Public methods (0)No public methods.
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…