stock_restrict_source_location/README.md
2026-02-13 14:37:52 +07:00

1.2 KiB

Stock Restrict Source Location

This module implements strict location filtering for Stock moves and Manufacturing Orders based on the configuration set in the Operation Type.

Features

  • UI-Level Restriction: Restricts the "Pick From" location selection in both standard Transfers and MO "Detailed Operations" dialogs.
  • Background Reservation Restriction: Overrides the reservation engine (_get_gather_domain) to ensure auto-pick (Check Availability) only pulls stock from authorized locations.
  • MO Support: Specifically handles Manufacturing Orders by injecting the active_mo_id and active_move_id into the context.
  • Frontend Patch: Includes a JavaScript patch (stock_move_line_x2_many_field_patch.js) to ensure picking type context is maintained during frontend searches.

Dependencies

  • stock
  • mrp
  • stock_picking_type_m2m (Used to retrieve the list of allowed locations)

Usage

  1. Configure Allowed Source Locations on your Operation Type (e.g., Manufacturing).
  2. Create an MO or Transfer using that Operation Type.
  3. Both manual selection and the "Check Availability" button will now be restricted to precisely the locations you defined.