OdooWiki OCA HUB

Stock Available Base Exclude Location

stock_available_base_exclude_location folder_open OCA/stock-logistics-availability open_in_new
Warehouse License: AGPL-3

This module is a technical base module to allow defining excluded locations on an Odoo model.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

This technical base module lets other Odoo modules exclude specific stock locations when calculating a product's available quantity. It provides a reusable mixin to store excluded locations or a location filter, and adjusts the product availability calculation accordingly.

This is a technical foundation module: on its own it does not add menus, buttons or reports. It gives developers a reusable building block so that other modules can decide which stock locations should be ignored when Odoo computes how much of a product is available.

It adds a mixin model, stock.exclude.location.mixin, that any other model can inherit. That mixin provides three fields: - stock_excluded_location_ids: a list of stock locations to exclude. - stock_excluded_location_domain_char: a text field where a location filter can be typed, defaulting to an empty list. - stock_excluded_location_domain: a computed version of that filter, ready for use in searches.

It also extends product.product by overriding _get_domain_locations_new. When the context contains excluded locations or an excluded-location filter, those are added to the search rules used for stock quants and incoming/outgoing moves, so the excluded locations no longer count towards available quantities.

Because the module only reacts to context values, nothing changes in Odoo until another module or a developer supplies those values. It touches the product availability calculation and the stock location model, and is meant to be extended rather than used directly by end users.

Depends on

stock
Models and fields (2)
  • product.product · extends an existing model
  • stock.exclude.location.mixin · new modelstock_excluded_location_ids (Stock Excluded Locations), stock_excluded_location_domain, stock_excluded_location_domain_char (Domain to filter locations)

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: 4 confirmed, 5 with no information of 9 versions.

Sources · Odoo 18.0

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

terminal Installation and usage

OCA documentation · Odoo 18.0

In new module, inherit from "stock.exclude.location.mixin" model on the wanted model.

Then, when querying for product availability, add to context the key "excluded_location_ids" with your model "stock_excluded_location_ids" property.

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.