Skip to main content

Beta License: AGPL-3 OCA/stock-logistics-putaway Translate me on Weblate Try me on Runboat

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.

Table of contents

Usage

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.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Camptocamp

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/stock-logistics-putaway project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Release files for odoo-addon-stock-putaway-hook 18.0.1.0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo-addon-stock-putaway-hook 18.0.1.0.0.2
File Interpreter ABI Platform
odoo_addon_stock_putaway_hook-18.0.1.0.0.2-py3-none-any.whl Python 3 none any Details

Release files / odoo_addon_stock_putaway_hook-18.0.1.0.0.2-py3-none-any.whl

Download URL odoo_addon_stock_putaway_hook-18.0.1.0.0.2-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0ec8cf550f80423935debb8c0998942e843a6f3dc5b14d4b428941a661849ee0
BLAKE2b-256 checksum
How to use checksums
f2c8b6a64bba516a9b2f8a025b712ab576ef7f9ea65045ea6dce60a1c3b564c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page