OdooWiki OCA HUB

Stock Putaway Hooks

stock_putaway_hook folder_open OCA/stock-logistics-putaway open_in_new
Hidden License: AGPL-3

Technical module. It adds hooks to the core putaway method StockLocation._get_putaway_strategy() allowing to plug other strategies and makes the selector fields in the tree views dynamic (required/readonly). See the usage section for details.

An example of implementation is the module stock_putaway_by_route.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

This technical module lets other Odoo add-ons plug in extra putaway strategies, so incoming goods can be directed to storage locations based on rules beyond the standard product and product category.

This is a hidden technical module. It does not add any new menu, screen or button by itself. Instead, it extends the way Odoo chooses a destination location when products are received into a warehouse (the putaway process on stock.location).

  • It keeps the standard behaviour: Odoo first looks for a putaway rule matching the product, then one matching the product category.
  • If no standard rule is found, it can try additional strategies defined by other modules. Each strategy is identified by a field name on the putaway rule, and the value to match is passed through the context when the putaway is computed.
  • A strategy can match a single value or several values at once (for example a list of routes), and the search walks up the parent locations until a matching rule is found.
  • After all strategies have been tried, a final hook lets other modules adjust or confirm the chosen location.

Because the module only provides hooks, users will not see new screens. Its effect appears indirectly when modules built on top of it (for example a putaway-by-route module) are installed: received products are then routed to storage locations according to those extra rules.

Depends on

stock
Models and fields (1)
  • stock.location · extends an existing model

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 6 confirmed, 3 with no information of 9 versions.

Sources · Odoo 18.0

Confirmed on 2026-11-03 in branch 18.0 of OCA/stock-logistics-putaway.

terminal Installation and usage

OCA documentation · Odoo 18.0

The modules that implement a new strategy have to follow the following steps. The module stock_putaway_by_route should be used as reference.

Add the field to match on stock.putaway.rule in the model and in the view. In the view, the field must have options="{'exclusive_selection': True}", which will allow this module to dynamically build dynamic attrs, restricting the selection of more than one field. (defining the readonly and required attrs in the view is therefore useless).

Add the strategy key, named after the new field name, in StockLocation._putaway_strategies. Example:

class StockLocation(models.Model): _inherit = "stock.location"

@property def _putaway_strategies(self): strategies = super()._putaway_strategies return strategies + ["route_id"]

Pass the value to match with the putaway rule field in the context, in every method calling StockLocation._get_putaway_strategy. The name of the key in the context is:_putaway_<KEY>, where KEY is the name of the new field on the putaway rule. The value can be a unit, a recordset of any length or a list/tuple. In latter cases, the putaway rule is selected if its field match any value in the list/recordset.

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.