Metadata-Version: 2.1
Name: odoo-addon-sale_stock_deposit
Version: 18.0.1.0.0.1
Requires-Python: >=3.10
Requires-Dist: odoo==18.0.*
Summary: Sale Stock deposit
Home-page: https://github.com/sygel-technology/sy-sale-workflow
License: AGPL-3
Author: Sygel
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 18.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Description-Content-Type: text/x-rst

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

==================
Sale Stock Deposit
==================

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

.. |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-sygel--technology%2Fsy--sale--workflow-lightgray.png?logo=github
    :target: https://github.com/sygel-technology/sy-sale-workflow/tree/18.0/sale_stock_deposit
    :alt: sygel-technology/sy-sale-workflow

|badge1| |badge2| |badge3|

This module helps you to create and control stock deposits for customer
sales.

With the deposits, you will be able to create:

1. Deposit Sales: Sales and pickings that act as a stock reservation in
   your deposit for a customer
2. Deposit Deliveries: Sales and pickigs that act as the delivery of the
   reserved stock of the deposit. This sales are not invoiced.

This is achieved with some special warehouse operation types and routes,
that this module provides.

NOTE: As the deposits are reservation locations, we represent this
putting in them negative amounts. That decreases the stock count of the
warehouse, and prevents it from being taking into account in the
available stock calculation. For this reason, despite that the stock is
correcly calculated, the special warehouse operations are less
intuitive.

**Table of contents**

.. contents::
   :local:

Installation
============

Note: Once installed the module will create the warehouses, types of
operations, routes and rules for each warehouse available. This will
also be done automatically for each warehouse you create after the
installation.

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

To configure this module, you need to:

1. Go to the Inventory module
2. Click on Configuration and then Settings
3. In the Traceability section activate 'Lots & Serial Numbers'.
4. In the Warehouse section activate 'Storage Locations' and 'Multi-Step
   Routes'.

To create a customer's deposit:

1. From the contact, go to the 'Stock deposit' tab and click on 'Create
   New Deposit'.
2. Enter the name. By default 'Deposit + <contact_name>'.
3. Select the Location from the different available deposits and save.

Usage
=====

To use this module, you need to:

To create a new 'Deposit Sale':

1. Create a new quotation.
2. Select a customer who has a deposit.
3. Go to the 'Other Info' tab -> 'Delivery' section
4. Select the warehouse where the customer's deposit is located.
5. Add a new product and Select the Route: '(<warehouse_name>) / Deposit
   Sale'
6. Confirm the Sale
7. Validate the generated picking. Remember to set the done quantities
   manually.
8. This picking will 'reserve' the stock of that product in your
   warehouse for the customer. This is achieved by moving (in Odoo) the
   stock from the deposit location to the customer location. Though the
   product is still in warehouse and it has not been delivered yet, it
   belongs to the customer, and the negative stock in the deposit
   location represents this, reserving the product for him.

To create a new 'Deposit Delivery':

1. Create a new quotation.
2. Select a customer who has a deposit.
3. Go to the 'Other Info' tab -> 'Delivery' section
4. Select the warehouse where the customer's deposit is located.
5. Add the same product that was added to the deposit in the sale to
   deposit.
6. Select the Route: '(<warehouse_name>) / Deposit Delivery'
7. Confirm the Sale
8. Validate the generated picking
9. This picking will remove the stock from the deposit, completing the
   delivery cicle in odoo. This is achieved by moving the stock (in
   odoo) from the deposit location to the customer location. This
   operation works correcly because the stock has previously been moved
   (in odoo) to the customer location, and the deposit location is
   negative.

On the other hand, you will be able to see the state of the customer's
deposits.

1. Go to the 'Stock Deposits' tab of the contact and click on 'View
   Deposit Status', if you only want to see the status of one deposit.
2. From the contact's view header click on 'Deposits' to see the status
   of all the customer's deposits.

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

- In future versions, we will consider modifying the sale order line
  widget to show the available quantity of the product in the customer's
  deposit.

- Note: If you make a 'Deposit Sale' of a product with lot numbers. You
  will need to use the same lot number in the 'Deposit Delivery', or
  another existing lot in the deposit. Odoo is not able to automatically
  select by default a lot that is in the deposit, because deposit
  delivery operations do not have the deposit as origin (the location
  odoo uses to get the lots). You can also make an inventory adjustment
  to fix this.

- The code inside the \_search_rule() has been encapsulated in another
  function and also called from \_get_rule(). Now, \_get_rule() does not
  call \_search_rule() inside sales confirmations, so the code to get
  the deposit rule has been moved to \_get_rule(). Other functions could
  have been inherited, but, as they were too complex, this is the best
  way.

- The res_partner fields should be reviewed to determine if they should
  be commercial fields.

- Potential issue with multi-company configuration.

- Potential issue with contact merging.

- Review inherited functions.

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

Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-sale-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/sygel-technology/sy-sale-workflow/issues/new?body=module:%20sale_stock_deposit%0Aversion:%2018.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
-------

* Sygel

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

- `Sygel <https://www.sygel.es>`__:

  - Ángel García de la Chica Herrera
  - Valentin Vinagre
  - Alberto Martínez
  - Harald Panten

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

This module is part of the `sygel-technology/sy-sale-workflow <https://github.com/sygel-technology/sy-sale-workflow/tree/18.0/sale_stock_deposit>`_ project on GitHub.

You are welcome to contribute.
