mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[14.0][ADD] agreement_tier_validation
This commit is contained in:
3
agreement_tier_validation/__init__.py
Normal file
3
agreement_tier_validation/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from . import models
|
||||||
16
agreement_tier_validation/__manifest__.py
Normal file
16
agreement_tier_validation/__manifest__.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Copyright 2022 Ecosoft Co., Ltd.
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
{
|
||||||
|
"name": "Agreement Tier Validation",
|
||||||
|
"summary": "Extends the functionality of Agreement to "
|
||||||
|
"support a tier validation process.",
|
||||||
|
"version": "14.0.1.0.0",
|
||||||
|
"category": "Contract Management",
|
||||||
|
"website": "https://github.com/OCA/contract",
|
||||||
|
"author": "Ecosoft, Odoo Community Association (OCA)",
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"application": False,
|
||||||
|
"installable": True,
|
||||||
|
"depends": ["agreement_legal", "base_tier_validation"],
|
||||||
|
"data": ["views/agreement_view.xml"],
|
||||||
|
}
|
||||||
4
agreement_tier_validation/models/__init__.py
Normal file
4
agreement_tier_validation/models/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from . import agreement
|
||||||
|
from . import tier_definition
|
||||||
13
agreement_tier_validation/models/agreement.py
Normal file
13
agreement_tier_validation/models/agreement.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Copyright 2022 Ecosoft Co., Ltd.
|
||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo import models
|
||||||
|
|
||||||
|
|
||||||
|
class Agreement(models.Model):
|
||||||
|
_name = "agreement"
|
||||||
|
_inherit = ["agreement", "tier.validation"]
|
||||||
|
_state_from = ["draft"]
|
||||||
|
_state_to = ["active"]
|
||||||
|
|
||||||
|
_tier_validation_manual_config = False
|
||||||
14
agreement_tier_validation/models/tier_definition.py
Normal file
14
agreement_tier_validation/models/tier_definition.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Copyright 2022 Ecosoft Co., Ltd.
|
||||||
|
# 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("agreement")
|
||||||
|
return res
|
||||||
4
agreement_tier_validation/readme/CONFIGURE.rst
Normal file
4
agreement_tier_validation/readme/CONFIGURE.rst
Normal 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 Agreement model.
|
||||||
1
agreement_tier_validation/readme/CONTRIBUTORS.rst
Normal file
1
agreement_tier_validation/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
* Kitti U. <kittiu@ecosoft.co.th>
|
||||||
2
agreement_tier_validation/readme/DESCRIPTION.rst
Normal file
2
agreement_tier_validation/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
This module extends the functionality of Agreement to support a tier
|
||||||
|
validation process.
|
||||||
2
agreement_tier_validation/readme/INSTALL.rst
Normal file
2
agreement_tier_validation/readme/INSTALL.rst
Normal 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>`_
|
||||||
14
agreement_tier_validation/readme/USAGE.rst
Normal file
14
agreement_tier_validation/readme/USAGE.rst
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
To use this module, you need to:
|
||||||
|
|
||||||
|
#. Create a Agreement 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 the State can be set to "active".
|
||||||
|
|
||||||
|
Additional features:
|
||||||
|
|
||||||
|
* You can filter the Agreement requesting your review through the filter *Needs my
|
||||||
|
Review*.
|
||||||
|
* User with rights to confirm the Agreement (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.
|
||||||
BIN
agreement_tier_validation/static/description/icon.png
Normal file
BIN
agreement_tier_validation/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
3
agreement_tier_validation/tests/__init__.py
Normal file
3
agreement_tier_validation/tests/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from . import test_tier_validation
|
||||||
10
agreement_tier_validation/tests/test_tier_validation.py
Normal file
10
agreement_tier_validation/tests/test_tier_validation.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Copyright 2022 Ecosoft Co., Ltd.
|
||||||
|
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
|
||||||
|
|
||||||
|
from odoo.addons.base_tier_validation.tests.common import CommonTierValidation
|
||||||
|
|
||||||
|
|
||||||
|
class TestAgreementTierValidation(CommonTierValidation):
|
||||||
|
def test_01_tier_definition_models(self):
|
||||||
|
res = self.tier_def_obj._get_tier_validation_model_names()
|
||||||
|
self.assertIn("agreement", res)
|
||||||
25
agreement_tier_validation/views/agreement_view.xml
Normal file
25
agreement_tier_validation/views/agreement_view.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<record id="view_agreement_filter" model="ir.ui.view">
|
||||||
|
<field name="name">agreement.select - agreement_tier_validation</field>
|
||||||
|
<field name="model">agreement</field>
|
||||||
|
<field name="inherit_id" ref="agreement_legal.partner_agreement_search_view" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<filter name="filter_templates" position="after">
|
||||||
|
<separator />
|
||||||
|
<filter
|
||||||
|
name="needs_review"
|
||||||
|
string="Needs my Review"
|
||||||
|
domain="[('reviewer_ids','in',uid), ('state', 'not in', ['active', 'inactive'])]"
|
||||||
|
help="My Areements to review"
|
||||||
|
/>
|
||||||
|
<filter
|
||||||
|
name="tier_validated"
|
||||||
|
string="Validated"
|
||||||
|
domain="[('validated', '=', True)]"
|
||||||
|
help="Agreements validated and ready to be active"
|
||||||
|
/>
|
||||||
|
</filter>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../../../../agreement_tier_validation
|
||||||
6
setup/agreement_tier_validation/setup.py
Normal file
6
setup/agreement_tier_validation/setup.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
setup_requires=['setuptools-odoo'],
|
||||||
|
odoo_addon=True,
|
||||||
|
)
|
||||||
1
test-requirements.txt
Normal file
1
test-requirements.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
odoo_test_helper
|
||||||
Reference in New Issue
Block a user