Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions stock_request_tier_validation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=============================
Stock Request Tier Validation
=============================

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

.. |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-OCA%2Ftier--validation-lightgray.png?logo=github
:target: https://github.com/OCA/tier-validation/tree/19.0/stock_request_tier_validation
:alt: OCA/tier-validation
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/tier-validation-19-0/tier-validation-19-0-stock_request_tier_validation
: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/tier-validation&target_branch=19.0
:alt: Try me on Runboat

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

This module extends the functionality of Stock Requests and Stock
Request Orders to support a tier validation process.

.. 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:

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

This module depends on the module ``stock_request`` available in the
`stock-logistics-request <https://github.com/OCA/stock-logistics-request>`__
repository.

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

To configure this module, you need to:

1. Go to *Settings > Technical > Tier Validations > Tier Definition*.
2. Create as many tiers as you want for Stock Request or Stock Request
Order models.

Usage
=====

To use this module, you need to:

1. Create a Stock Request or a Stock Request Order triggering at least
one "Tier Definition".
2. Click on *Request Validation* button.
3. Under the tab *Reviews* have a look to pending reviews and their
statuses.
4. Once all reviews are validated click on *Confirm*.

Additional features:

- You can filter the Stock Requests and Stock Request Orders requesting
your review through the filter *Needs my Review*.
- User with rights to validate the Stock Request or Stock Request Order
(validate all tiers that would be generated) can directly do the
operation, this is, there is no need for her/him to request a
validation.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/tier-validation/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/tier-validation/issues/new?body=module:%20stock_request_tier_validation%0Aversion:%2019.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
-------

* Jarsa

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

- `Jarsa <https://www.jarsa.com>`__:

- Alan Ramos <alan.ramos@jarsa.com>

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.

This module is part of the `OCA/tier-validation <https://github.com/OCA/tier-validation/tree/19.0/stock_request_tier_validation>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions stock_request_tier_validation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
20 changes: 20 additions & 0 deletions stock_request_tier_validation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2026 Jarsa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Stock Request Tier Validation",
"summary": "Extends the functionality of Stock Requests to "
"support a tier validation process.",
"version": "19.0.1.0.0",
"category": "Warehouse Management",
"website": "https://github.com/OCA/tier-validation",
"author": "Jarsa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"development_status": "Alpha",
"depends": ["stock_request", "base_tier_validation"],
"data": [
"views/stock_request_views.xml",
"views/stock_request_order_views.xml",
],
"installable": True,
}
3 changes: 3 additions & 0 deletions stock_request_tier_validation/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import stock_request
from . import stock_request_order
from . import tier_definition
13 changes: 13 additions & 0 deletions stock_request_tier_validation/models/stock_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2026 Jarsa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class StockRequest(models.Model):
_name = "stock.request"
_inherit = ["stock.request", "tier.validation"]
_state_from = ["draft"]
_state_to = ["open"]

_tier_validation_manual_config = False
38 changes: 38 additions & 0 deletions stock_request_tier_validation/models/stock_request_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2026 Jarsa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models
from odoo.exceptions import ValidationError


class StockRequestOrder(models.Model):
_name = "stock.request.order"
_inherit = ["stock.request.order", "tier.validation"]
_state_from = ["draft"]
_state_to = ["open"]

_tier_validation_manual_config = False
# state is a stored computed field on stock.request.order
_tier_validation_state_field_is_computed = True

def action_confirm(self):
# state is computed and flushed lazily, so validate explicitly
# before confirming instead of relying on the write() check
for rec in self:
if rec.need_validation:
reviews = rec.request_validation()
rec._validate_tier(reviews)
if rec.validation_status != "validated":
raise ValidationError(
self.env._(
"This action needs to be validated for at least "
"one record. \nPlease request a validation."
)
)
if rec.review_ids and rec.validation_status != "validated":
raise ValidationError(
self.env._(
"A validation process is still open for at least one record."
)
)
return super().action_confirm()
15 changes: 15 additions & 0 deletions stock_request_tier_validation/models/tier_definition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2026 Jarsa
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, models


class TierDefinition(models.Model):
_inherit = "tier.definition"

@api.model
def _get_tier_validation_model_names(self):
res = super()._get_tier_validation_model_names()
res.append("stock.request")
res.append("stock.request.order")
return res
3 changes: 3 additions & 0 deletions stock_request_tier_validation/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
6 changes: 6 additions & 0 deletions stock_request_tier_validation/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To configure this module, you need to:

1. Go to *Settings \> Technical \> Tier Validations \> Tier
Definition*.
2. Create as many tiers as you want for Stock Request or Stock
Request Order models.
2 changes: 2 additions & 0 deletions stock_request_tier_validation/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Jarsa](https://www.jarsa.com):
- Alan Ramos \<<alan.ramos@jarsa.com>\>
2 changes: 2 additions & 0 deletions stock_request_tier_validation/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module extends the functionality of Stock Requests and Stock
Request Orders to support a tier validation process.
3 changes: 3 additions & 0 deletions stock_request_tier_validation/readme/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This module depends on the module `stock_request` available in the
[stock-logistics-request](https://github.com/OCA/stock-logistics-request)
repository.
17 changes: 17 additions & 0 deletions stock_request_tier_validation/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
To use this module, you need to:

1. Create a Stock Request or a Stock Request Order triggering at least
one "Tier Definition".
2. Click on *Request Validation* button.
3. Under the tab *Reviews* have a look to pending reviews and their
statuses.
4. Once all reviews are validated click on *Confirm*.

Additional features:

- You can filter the Stock Requests and Stock Request Orders requesting
your review through the filter *Needs my Review*.
- User with rights to validate the Stock Request or Stock Request Order
(validate all tiers that would be generated) can directly do the
operation, this is, there is no need for her/him to request a
validation.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading