forked from OCA/contract
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[14.0][ADD] agreement_tier_validation
- Loading branch information
Showing
17 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import agreement | ||
from . import tier_definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Kitti U. <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This module extends the functionality of Agreement to support a tier | ||
validation process. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_tier_validation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
1 change: 1 addition & 0 deletions
1
setup/agreement_tier_validation/odoo/addons/agreement_tier_validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../agreement_tier_validation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
odoo_test_helper |