Merge PR #1533 into 14.0

Signed-off-by dreispt
This commit is contained in:
OCA-git-bot
2024-03-14 18:16:40 +00:00
17 changed files with 232 additions and 0 deletions

View File

@@ -0,0 +1 @@
../../../../stock_inventory_tier_validation

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

View File

@@ -0,0 +1,107 @@
====================================
Inventory Adjustment Tier Validation
====================================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/licence-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/14.0/stock_inventory_tier_validation
: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-14-0/stock-logistics-workflow-14-0-stock_inventory_tier_validation
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/142/14.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module extends the functionality of Inventory Adjustments to support a tier
validation process.
**Table of contents**
.. contents::
:local:
Installation
============
This module depends on ``base_tier_validation``. You can find it at
`OCA/server-ux <https://github.com/OCA/server-ux>`_
Configuration
=============
To configure this module, you need to:
#. Go to *Settings > Technical > Tier Validations > Tier Definition*.
#. Create as many tiers as you want for Inventory Adjustment model.
Usage
=====
To use this module, you need to:
#. Create a Inventory Adjustments triggering at least one "Tier Definition".
#. Click on *Request Validation* button.
#. Under the tab *Reviews* have a look to pending reviews and their statuses.
#. Once all reviews are validated click on *Confirm Order*.
Additional features:
* You can filter the Inventory Adjustments requesting your review through the
filter *Needs my Review*.
* User with rights to confirm the Inventory Adjustment
(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/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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_inventory_tier_validation%0Aversion:%2014.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
~~~~~~~
* Open Source Integrators
Contributors
~~~~~~~~~~~~
* Patrick Wilson <pwilson@opensourceintegrators.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/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/14.0/stock-logistics-workflow_tier_validation>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -0,0 +1,4 @@
# Copyright (C) 2022 Open Source Integrators
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import models

View File

@@ -0,0 +1,17 @@
# Copyright (C) 2022 Open Source Integrators
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock Inventory Adjustment Tier Validation",
"summary": "Extends the functionality of Adjustments to "
"support a tier validation process.",
"version": "14.0.1.0.0",
"category": "Stock Management",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"maintainers": ["patrickrwilson"],
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["stock", "base_tier_validation"],
"data": ["views/stock_inventory_views.xml"],
}

View File

@@ -0,0 +1,5 @@
# Copyright (C) 2022 Open Source Integrators
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import stock_inventory
from . import tier_definition

View File

@@ -0,0 +1,13 @@
# Copyright (C) 2022 Open Source Integrators
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
class StockInventory(models.Model):
_name = "stock.inventory"
_inherit = ["stock.inventory", "tier.validation"]
_state_from = ["draft", "confirm"]
_state_to = ["done"]
_tier_validation_manual_config = False

View File

@@ -0,0 +1,14 @@
# Copyright (C) 2022 Open Source Integrators
# 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(TierDefinition, self)._get_tier_validation_model_names()
res.append("stock.inventory")
return res

View File

@@ -0,0 +1,4 @@
To configure this module, you need to:
#. Go to *Settings > Technical > Tier Validations > Tier Definition*.
#. Create as many tiers as you want for Inventory Adjustment model.

View File

@@ -0,0 +1 @@
* Patrick Wilson <pwilson@opensourceintegrators.com>

View File

@@ -0,0 +1,2 @@
This module extends the functionality of Inventory Adjustments to support a tier
validation process.

View File

@@ -0,0 +1,2 @@
This module depends on ``base_tier_validation``. You can find it at
`OCA/server-ux <https://github.com/OCA/server-ux>`_

View File

@@ -0,0 +1,15 @@
To use this module, you need to:
#. Create a Inventory Adjustments triggering at least one "Tier Definition".
#. Click on *Request Validation* button.
#. Under the tab *Reviews* have a look to pending reviews and their statuses.
#. Once all reviews are validated click on *Confirm Order*.
Additional features:
* You can filter the Inventory Adjustments requesting your review through the
filter *Needs my Review*.
* User with rights to confirm the Inventory Adjustment
(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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,4 @@
# Copyright (C) 2022 Open Source Integrators
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import test_tier_validation

View File

@@ -0,0 +1,10 @@
# Copyright (C) 2022 Open Source Integrators
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.addons.base_tier_validation.tests.common import CommonTierValidation
class TestStockInventoryTierValidation(CommonTierValidation):
def test_01_tier_definition_models(self):
res = self.tier_def_obj._get_tier_validation_model_names()
self.assertIn("stock.inventory", res)

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (C) 2022 Open Source Integrators
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="view_stock_inventory_search" model="ir.ui.view">
<field name="name">stock.inventory.tier.validation.search</field>
<field name="model">stock.inventory</field>
<field name="inherit_id" ref="stock.view_inventory_filter" />
<field name="arch" type="xml">
<filter name="inventories_month" position="after">
<separator />
<filter
name="needs_review"
string="Needs my Review"
domain="[('reviewer_ids','in',uid), ('state', 'not in', ['finished', 'locked', 'cancelled'])]"
help="My Inventory Adjustments to review"
/>
<filter
name="tier_validated"
string="Validated"
domain="[('validated', '=', True)]"
help="Inventory Adjustments validated and ready to be confirmed"
/>
</filter>
</field>
</record>
</odoo>