Metadata-Version: 2.1
Name: odoo-addon-budget_control_stock
Version: 18.0.1.0.0.1
Requires-Python: >=3.10
Requires-Dist: odoo-addon-budget_control==18.0.*
Requires-Dist: odoo-addon-stock_analytic==18.0.*
Requires-Dist: odoo==18.0.*
Summary: Budget Control on Stock
Home-page: https://github.com/ecosoft-odoo/budgeting
License: AGPL-3
Author: Ecosoft, Odoo Community Association (OCA)
Author-email: support@odoo-community.org
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 18.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Development Status :: 3 - Alpha
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

=======================
Budget Control on Stock
=======================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
    :target: https://odoo-community.org/page/development-status
    :alt: Alpha
.. |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-ecosoft--odoo%2Fbudgeting-lightgray.png?logo=github
    :target: https://github.com/ecosoft-odoo/budgeting/tree/18.0/budget_control_stock
    :alt: ecosoft-odoo/budgeting

|badge1| |badge2| |badge3|

This module adds budget control on stock operations, so that goods
issued from inventory consume budget independently from the related
purchase or sale documents.

When an outgoing transfer (delivery) of an operation type with
``Commit Budget`` enabled is confirmed, a ``stock.budget.move``
commitment is created per analytic account. The committed amount is the
move quantity valued at the configured price source: the stock move's
unit price (falling back to product standard price when empty) or the
lot standard price. When the transfer is validated, the stock journal
entry is posted and recorded as budget *actual* (from the stock
valuation value), while the original stock commitment is released, so
the budget consumption moves smoothly from *commitment* to *actual*.
Cancelling or reverting the transfer removes the commitment.

The committed amount can be reviewed on the *Budget Commitment* tab of
the stock transfer and on the budget monitoring report.

Open stock commitments (transfers confirmed but not yet validated at the
end of a budget period) are carried forward to the next period together
with the other commitment types of the standard *Budget Commit Forward*
document.

.. IMPORTANT::
   This is an alpha version, the data model and design can change at any time without warning.
   Only for development or testing purpose, do not use in production.
   `More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
   :local:

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

To configure this module, you need to:

#. Go to *Inventory > Configuration > Operation Types*. #. Open the
operation type that issues goods from inventory (for example *Delivery
Orders*) and enable ``Commit Budget``. Confirming a transfer of this
operation type will then create budget commitments. #. Choose the
``Budget Price Source`` used to value the commitment:

- *Move Unit Price* (default): uses ``price_unit`` from the stock move
  first. Falls back to ``product.standard_price`` when ``price_unit`` is
  empty.
- *Lot Standard Price*: uses ``lot.standard_price`` per reserved lot
  (weighted average if multiple lots), for FIFO / lot-based costing.
  Falls back to Move Unit Price when no lots are reserved.

#. Go to *Budgeting > Configuration > Budget Periods*, open the relevant
period and tick ``On Stock`` to control the budget against stock
commitments. When ``Control Budget`` is enabled the flag follows it by
default.

Notes:

- Stock moves must carry an analytic distribution (provided by the
  *stock_analytic* dependency); commitments are created per analytic
  account.
- Recording the related stock journal entry as budget *actual* relies on
  the standard journal-entry budget flow, so make sure the stock journal
  entries carry the analytic distribution of the moves.

Usage
=====

To use this module, you need to:

#. Make sure the operation type and the budget period are configured
(see *Configuration*) and that the budget control sheet of the analytic
account is in *Controlled* status. #. Create an outgoing transfer
(delivery) whose stock moves carry an analytic distribution. #. Confirm
the transfer. For each analytic account, a budget commitment is created
from the configured price source (move unit price or lot standard
price). If the budget is not sufficient and the period blocks
over-budget transactions, confirmation is refused. #. Review the
committed amount on the *Budget Commitment* tab of the transfer, on the
budget control sheet (``Stock`` column) or on the budget monitoring
report. #. Validate the transfer. The stock journal entry is posted and
recorded as budget *actual*, and the matching stock commitment is
released, so consumption moves from *commitment* to *actual*.

Cancelling, reverting to draft or returning the transfer removes the
related commitment.

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

Bugs are tracked on `GitHub Issues <https://github.com/ecosoft-odoo/budgeting/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/ecosoft-odoo/budgeting/issues/new?body=module:%20budget_control_stock%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
-------

* Ecosoft

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

- Saran Lim. <saranl@ecosoft.co.th>

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

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

Current maintainer:

|maintainer-Saran440| 

This module is part of the `ecosoft-odoo/budgeting <https://github.com/ecosoft-odoo/budgeting/tree/18.0/budget_control_stock>`_ project on GitHub.

You are welcome to contribute.
