OdooWiki OCA HUB

Stock Available Location Get Domain

stock_available_location_get_domain folder_open OCA/stock-logistics-availability open_in_new
Uncategorised License: AGPL-3

This is a technical helper module in order to reuse the standard get_domain_locations function for locations and not quants.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Technical helper module that lets other Odoo modules reuse the standard stock location domain logic for locations instead of stock quants. It adds no visible screens or menus for end users.

This is a technical helper module with no user interface. It does not add menus, buttons, reports or settings that a business user would see in Odoo.

What it changes is internal behaviour: it extends the product.product model with a new method, _get_domain_location_for_locations. This method takes the domain that Odoo normally builds for stock quants (the records that hold quantities per product and location) and converts it so it can be applied to stock locations instead.

In practice, the module reads the standard quant domain, extracts only the parts that refer to the location field, and rewrites those parts so they match the location model. It handles domain operators such as AND, OR and NOT, and also the special "any" operator used for related records. The result is a clean domain that other modules can use to search or filter locations using the same rules Odoo already applies to quants.

Because it only provides this conversion helper, it does not by itself change any calculation, check, default value, email or scheduled job. Its effect appears only when another module calls the new method. It depends on the standard stock module and touches the product.product model.

Depends on

stock
Models and fields (1)
  • product.product · 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: 2 confirmed, 7 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

Call the new get_domain_location_for_locations() function on products in order to retrieve a domain for stock locations with the same context behavior as for product availability.

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.