Metadata-Version: 2.1
Name: odoo-addon-stock_quant_lock
Version: 16.0.2.0.0.5
Summary: Lock selected quants to prevent new reservations and keep stock move traceability
Home-page: https://github.com/OCA/stock-logistics-workflow
Author: ACSONE SA/NV, BCIM, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
License: AGPL-3
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 16.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Requires-Python: >=3.10
Requires-Dist: odoo<16.1dev,>=16.0a

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

================
Stock Quant Lock
================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:537234fb3deb584d7b9a351576c1b81d1891599fc2b30117f37ca7dec95bdc78
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
    :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github
    :target: https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_quant_lock
    :alt: OCA/stock-logistics-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_quant_lock
    :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
    :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&target_branch=16.0
    :alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds a quant lock mechanism based on standard stock
reservations. When a quant is locked, its non-reserved quantity is
reserved by a dedicated stock picking so it cannot be consumed by other
operations.

The lock operation is done through a selectable route explicitly
configured for quant locking: the push rule of the route defines the
operation type, the destination and the grouping of the lock transfer.
Unlocking cancels the lock picking, which releases the corresponding
reservation while keeping full traceability through standard Odoo stock
documents.

**Table of contents**

.. contents::
   :local:

Use Cases / Context
===================

Warehouse teams sometimes need to temporarily protect specific stock
from standard reservations, for example for quality checks, customer
claims, investigation, or internal allocation decisions. In standard
usage, free stock can still be consumed by other transfers, which makes
these temporary holds hard to enforce and hard to audit.

This module addresses that business need by using native Odoo
reservation mechanisms instead of introducing a parallel lock system. A
dedicated lock transfer is created and reserves the free quantity of a
selected quant. Because the lock is represented as standard stock
documents, operations teams keep full traceability and can reuse native
stock workflows for review.

The module is especially useful in multi-user environments where
concurrent reservations are frequent and temporary stock holds must
remain explicit, reversible, and auditable.

Configuration
=============

A *Quality Check* route is created for each warehouse. It locks quants
of any location of the warehouse with a dedicated *Quality Check*
operation type to the *Quality Check* location of the warehouse. It can
be used as is or adapted, and is the simplest way to start using this
module.

To configure other lock routes, you need to:

- Go to *Inventory > Configuration > Routes*.
- Create or open the route that will be used for quant locking.
- Enable *Allow quant lock*.
- Add a *Push To* rule. Its source location must contain the locations
  of the quants to lock, its destination location and operation type
  define the lock transfer. The *Reservation Method* of this operation
  type must be *At Confirmation*.

When several rules of the route match the location of a quant, the rule
with the most specific source location is used, then the rule sequence.
As for any rule, the *Propagation of Procurement Group* option of the
rule defines how lock moves are grouped into transfers.

Only routes with *Allow quant lock* enabled can be selected when locking
quants.

Usage
=====

To use this module, you need to:

- Go to *Inventory > Reporting > Locations* (or any inventory quant
  view).
- Open the quant to lock.
- Click *Lock Quant*.
- In the wizard, select a route configured for quant locking.
- Confirm.

For batch operations from list views:

- Select several quants.
- Use *Action > Lock Quants* and confirm the wizard.
- To release several locks at once, select locked quants and use *Action
  > Unlock Quants*.

The quant form also includes a *Lock Moves* smart button that opens the
complete history of moves linked to the quant lock.

After confirmation, a lock picking is created and reserved. The quant
displays the linked lock picking.

To unlock, open the same quant and click *Unlock Quant*. The lock
picking is cancelled and the reservation is released.

Known issues / Roadmap
======================

- Add a dedicated smart button on quants to open lock transfer history.
- Add optional reason and expiration date on lock operations.
- Add optional security groups to restrict lock and unlock operations.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/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 <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_quant_lock%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* ACSONE SA/NV
* BCIM

Contributors
------------

- Laurent Mignon laurent.mignon@acsone.eu (https://www.acsone.eu)
- Jacques-Etienne Baudoux je@bcim.be (BCIM)

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

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.

.. |maintainer-lmignon| image:: https://github.com/lmignon.png?size=40px
    :target: https://github.com/lmignon
    :alt: lmignon
.. |maintainer-jbaudoux| image:: https://github.com/jbaudoux.png?size=40px
    :target: https://github.com/jbaudoux
    :alt: jbaudoux

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-lmignon| |maintainer-jbaudoux| 

This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_quant_lock>`_ project on GitHub.

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