From deeedd109776e5481a84bb73e8e37877961d33d0 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Tue, 16 Feb 2021 09:52:49 +0000 Subject: [PATCH 01/47] [ADD] partner_tier_validation --- partner_tier_validation/README.rst | 92 +++++++++++++++++ partner_tier_validation/__init__.py | 3 + partner_tier_validation/__manifest__.py | 20 ++++ partner_tier_validation/models/__init__.py | 5 + partner_tier_validation/models/res_partner.py | 20 ++++ .../models/tier_validation.py | 53 ++++++++++ .../static/description/icon.png | Bin 0 -> 9455 bytes .../views/res_partner_view.xml | 96 ++++++++++++++++++ 8 files changed, 289 insertions(+) create mode 100644 partner_tier_validation/README.rst create mode 100644 partner_tier_validation/__init__.py create mode 100644 partner_tier_validation/__manifest__.py create mode 100644 partner_tier_validation/models/__init__.py create mode 100644 partner_tier_validation/models/res_partner.py create mode 100644 partner_tier_validation/models/tier_validation.py create mode 100644 partner_tier_validation/static/description/icon.png create mode 100644 partner_tier_validation/views/res_partner_view.xml diff --git a/partner_tier_validation/README.rst b/partner_tier_validation/README.rst new file mode 100644 index 00000000000..b6e7f63e64f --- /dev/null +++ b/partner_tier_validation/README.rst @@ -0,0 +1,92 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +==================== +Partner Tier Validation +==================== + +This module extends the functionality of Partner to support a tier +validation process. + +Installation +============ + +This module depends on ``base_tier_validation``. You can find it at +`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 Contact model. +#. Example: + Definition Formula + Tier Definition Expression + # Available locals: + # - rec: current record + + [rec.state == New] + +Usage +===== + +To use this module, you need to: + +#. Create a Contact triggering at least one "Tier Definition". +#. Click on *Request Validation* button. +#. Under the tab *Reviews* have a look to pending reviews and their statuses. +#. Validator has to update Is Customer or Is Supplier or Both for this Contact to be usable on SO/PO. + +Additional features: + +* You can filter the Invoices requesting your review through the filter *Needs my + Review*. +* User with rights to confirm the Vendor Bill (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. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/142/11.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Antonio Yamuta + +Do not contact contributors directly about support or help with technical issues. + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/partner_tier_validation/__init__.py b/partner_tier_validation/__init__.py new file mode 100644 index 00000000000..31660d6a965 --- /dev/null +++ b/partner_tier_validation/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py new file mode 100644 index 00000000000..b3f724a7a09 --- /dev/null +++ b/partner_tier_validation/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2019 Open Source Integrators +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Partner Tier Validation", + "summary": "Extends the functionality of Contacts to" + "support a tier validation process.", + "version": "12.0.1.0.0", + "category": "Contact", + "author": "Open Source Integrators, Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": [ + "contacts", + "base_tier_validation", + ], + "data": [ + "views/res_partner_view.xml", + ], +} diff --git a/partner_tier_validation/models/__init__.py b/partner_tier_validation/models/__init__.py new file mode 100644 index 00000000000..a415f52e719 --- /dev/null +++ b/partner_tier_validation/models/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2019 Open Source Integrators +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import res_partner +from . import tier_validation diff --git a/partner_tier_validation/models/res_partner.py b/partner_tier_validation/models/res_partner.py new file mode 100644 index 00000000000..2085f2c19f3 --- /dev/null +++ b/partner_tier_validation/models/res_partner.py @@ -0,0 +1,20 @@ +# Copyright 2019 Open Source Integrators +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models, fields + + +class ResPartner(models.Model): + _name = "res.partner" + _inherit = ['res.partner', 'tier.validation'] + _state_from = ['new', 'to approve'] + _state_to = ['approved'] + + # override core odoo to set default value to False + customer = fields.Boolean(string='Is a Customer', default=False, + help="Check this box if this contact is a customer. It can be selected in sales orders.") + + state = fields.Selection(selection=[('new','New'), + ('approved','Approved'),], + string='Status', + default='new' ) diff --git a/partner_tier_validation/models/tier_validation.py b/partner_tier_validation/models/tier_validation.py new file mode 100644 index 00000000000..515e3549efd --- /dev/null +++ b/partner_tier_validation/models/tier_validation.py @@ -0,0 +1,53 @@ +# Copyright 2019 Open Source Integrators +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, models, _ +from odoo.exceptions import ValidationError + +class TierValidation(models.AbstractModel): + _inherit = "tier.validation" + + @api.model + def _get_under_validation_exceptions(self): + res = super(TierValidation, self)._get_under_validation_exceptions() or [] + """Extend for more field exceptions.""" + ex_fields = ['categ_id','state', 'customer','supplier','excise_tax'] + for val in ex_fields: + res.append(val) + return res + + @api.multi + def validate_tier(self): + super(TierValidation, self).validate_tier() + # make sure to only work with res.partner object. + if self._name != 'res.partner': + return + for partner in self: + rec = self.env['tier.review'].search([('res_id','=',partner.id),('model','=','res.partner')]) + if rec and rec.status == 'approved': + if not (partner.customer or partner.supplier): + raise ValidationError(_('Cannot Validate. Please configure partner %s as a Customer or Vendor or Both.') % (partner.display_name)) + else: + partner.state = 'approved' + + # Need to override for Partner Tier Validation since can_review field is set to True based only + # if current user is a member of reviewer_ids. This can_review field is used to enable or disable the boolean + # field Is Customer / Is Vendor not only during the Validation process but even if it is in Approved State. + @api.multi + @api.depends('review_ids') + def _compute_reviewer_ids(self): + if str(self.__class__) == "": + for rec in self: + rec.reviewer_ids = rec.review_ids.filtered( + lambda r: r.status in ( 'pending','approved')).mapped('reviewer_ids') + else: + for rec in self: + rec.reviewer_ids = rec.review_ids.filtered( + lambda r: r.status == 'pending').mapped('reviewer_ids') + + @api.multi + def request_validation(self): + res = super().request_validation() + for rec in self.filtered(lambda x: x._name == 'res.partner'): + rec.message_subscribe(partner_ids=[self.env.user.partner_id.id,]) + return res diff --git a/partner_tier_validation/static/description/icon.png b/partner_tier_validation/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)( z;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3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/partner_tier_validation/views/res_partner_view.xml b/partner_tier_validation/views/res_partner_view.xml new file mode 100644 index 00000000000..81d72cbc3f0 --- /dev/null +++ b/partner_tier_validation/views/res_partner_view.xml @@ -0,0 +1,96 @@ + + + + + + partner.form.tier + res.partner + + + + +
+ +
+
+ +
+ + + + + + + +
+ + + + + {'readonly': [('can_review', '=', False)]} + + + {'readonly': [('can_review', '=', False)]} + + +
+
+ + + partner.form.tier.filter + res.partner + + + + + + + + + +
From 664e6925d46df7ae9bdea9d3593045ba84107fc2 Mon Sep 17 00:00:00 2001 From: Freni-OSI Date: Wed, 17 Feb 2021 16:00:11 +0530 Subject: [PATCH 02/47] [14.0][MIG]partner_tier_validation --- partner_tier_validation/README.rst | 4 +- partner_tier_validation/__manifest__.py | 12 +- partner_tier_validation/models/__init__.py | 2 +- partner_tier_validation/models/res_partner.py | 23 ++- .../models/tier_validation.py | 55 ++++--- .../views/res_partner_view.xml | 147 ++++++++++-------- 6 files changed, 127 insertions(+), 116 deletions(-) diff --git a/partner_tier_validation/README.rst b/partner_tier_validation/README.rst index b6e7f63e64f..c197ce0b704 100644 --- a/partner_tier_validation/README.rst +++ b/partner_tier_validation/README.rst @@ -2,9 +2,9 @@ :target: https://www.gnu.org/licenses/agpl :alt: License: AGPL-3 -==================== +======================= Partner Tier Validation -==================== +======================= This module extends the functionality of Partner to support a tier validation process. diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index b3f724a7a09..8aa407cacaa 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -1,19 +1,17 @@ -# Copyright 2019 Open Source Integrators +# Copyright 2021 Open Source Integrators # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Partner Tier Validation", "summary": "Extends the functionality of Contacts to" - "support a tier validation process.", - "version": "12.0.1.0.0", + "support a tier validation process.", + "version": "14.0.1.0.0", + "website": "https://github.com/OCA/partner-contact", "category": "Contact", "author": "Open Source Integrators, Odoo Community Association (OCA)", "license": "AGPL-3", "application": False, "installable": True, - "depends": [ - "contacts", - "base_tier_validation", - ], + "depends": ["contacts", "base_tier_validation", "partner_autocomplete"], "data": [ "views/res_partner_view.xml", ], diff --git a/partner_tier_validation/models/__init__.py b/partner_tier_validation/models/__init__.py index a415f52e719..9253d4876d6 100644 --- a/partner_tier_validation/models/__init__.py +++ b/partner_tier_validation/models/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2019 Open Source Integrators +# Copyright 2021 Open Source Integrators # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from . import res_partner diff --git a/partner_tier_validation/models/res_partner.py b/partner_tier_validation/models/res_partner.py index 2085f2c19f3..aeea2870a6f 100644 --- a/partner_tier_validation/models/res_partner.py +++ b/partner_tier_validation/models/res_partner.py @@ -1,20 +1,15 @@ -# Copyright 2019 Open Source Integrators +# Copyright 2021 Open Source Integrators # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import models, fields +from odoo import fields, models -class ResPartner(models.Model): +class ResPartner11(models.Model): _name = "res.partner" - _inherit = ['res.partner', 'tier.validation'] - _state_from = ['new', 'to approve'] - _state_to = ['approved'] + _inherit = ["res.partner", "tier.validation", "mail.activity.mixin"] + _state_from = ["new", "to approve"] + _state_to = ["approved"] - # override core odoo to set default value to False - customer = fields.Boolean(string='Is a Customer', default=False, - help="Check this box if this contact is a customer. It can be selected in sales orders.") - - state = fields.Selection(selection=[('new','New'), - ('approved','Approved'),], - string='Status', - default='new' ) + state = fields.Selection( + [("new", "New"), ("approved", "Approved")], string="Status", default="new" + ) diff --git a/partner_tier_validation/models/tier_validation.py b/partner_tier_validation/models/tier_validation.py index 515e3549efd..565cc1bb94f 100644 --- a/partner_tier_validation/models/tier_validation.py +++ b/partner_tier_validation/models/tier_validation.py @@ -1,53 +1,58 @@ -# Copyright 2019 Open Source Integrators +# Copyright 2021 Open Source Integrators # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import api, models, _ -from odoo.exceptions import ValidationError +from odoo import api, models + class TierValidation(models.AbstractModel): _inherit = "tier.validation" @api.model def _get_under_validation_exceptions(self): - res = super(TierValidation, self)._get_under_validation_exceptions() or [] """Extend for more field exceptions.""" - ex_fields = ['categ_id','state', 'customer','supplier','excise_tax'] + res = super(TierValidation, self)._get_under_validation_exceptions() or [] + ex_fields = ["categ_id", "state", "customer", "supplier", "excise_tax"] for val in ex_fields: res.append(val) return res - @api.multi def validate_tier(self): super(TierValidation, self).validate_tier() # make sure to only work with res.partner object. - if self._name != 'res.partner': - return + if self._name != "res.partner": + return for partner in self: - rec = self.env['tier.review'].search([('res_id','=',partner.id),('model','=','res.partner')]) - if rec and rec.status == 'approved': - if not (partner.customer or partner.supplier): - raise ValidationError(_('Cannot Validate. Please configure partner %s as a Customer or Vendor or Both.') % (partner.display_name)) - else: - partner.state = 'approved' + rec = self.env["tier.review"].search( + [("res_id", "=", partner.id), ("model", "=", "res.partner")] + ) + if rec and rec.status == "approved": + partner.state = "approved" - # Need to override for Partner Tier Validation since can_review field is set to True based only - # if current user is a member of reviewer_ids. This can_review field is used to enable or disable the boolean - # field Is Customer / Is Vendor not only during the Validation process but even if it is in Approved State. - @api.multi - @api.depends('review_ids') + # Need to override for Partner Tier Validation since can_review field + # is set to True based only + # if current user is a member of reviewer_ids. This can_review field + # is used to enable or disable the boolean + # field Is Customer / Is Vendor not only during the Validation process + # but even if it is in Approved State. + @api.depends("review_ids") def _compute_reviewer_ids(self): - if str(self.__class__) == "": + if str(self.__class__) == "": for rec in self: rec.reviewer_ids = rec.review_ids.filtered( - lambda r: r.status in ( 'pending','approved')).mapped('reviewer_ids') + lambda r: r.status in ("pending", "approved") + ).mapped("reviewer_ids") else: for rec in self: rec.reviewer_ids = rec.review_ids.filtered( - lambda r: r.status == 'pending').mapped('reviewer_ids') + lambda r: r.status == "pending" + ).mapped("reviewer_ids") - @api.multi def request_validation(self): res = super().request_validation() - for rec in self.filtered(lambda x: x._name == 'res.partner'): - rec.message_subscribe(partner_ids=[self.env.user.partner_id.id,]) + for rec in self.filtered(lambda x: x._name == "res.partner"): + rec.message_subscribe( + partner_ids=[ + self.env.user.partner_id.id, + ] + ) return res diff --git a/partner_tier_validation/views/res_partner_view.xml b/partner_tier_validation/views/res_partner_view.xml index 81d72cbc3f0..f6675dc5bfc 100644 --- a/partner_tier_validation/views/res_partner_view.xml +++ b/partner_tier_validation/views/res_partner_view.xml @@ -1,96 +1,109 @@ - - partner.form.tier res.partner - - - - + + +
- -
-
- - - - -
- - - - {'readonly': [('can_review', '=', False)]} - - - {'readonly': [('can_review', '=', False)]} - - + +
+
- + partner.form.tier.filter res.partner - + - - - + + - +
From 4bea287e4e64b4e7831c61da35627b3563c7b484 Mon Sep 17 00:00:00 2001 From: Freni-OSI Date: Wed, 3 Mar 2021 11:46:46 +0530 Subject: [PATCH 03/47] [14.0][IMP]Improved partner_tier_validation --- partner_tier_validation/__manifest__.py | 4 ++-- partner_tier_validation/models/__init__.py | 2 +- partner_tier_validation/models/res_partner.py | 4 ++-- partner_tier_validation/models/tier_validation.py | 2 +- partner_tier_validation/views/res_partner_view.xml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index 8aa407cacaa..c86cd1f144c 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -1,4 +1,4 @@ -# Copyright 2021 Open Source Integrators +# Copyright 2019 Open Source Integrators # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Partner Tier Validation", @@ -11,7 +11,7 @@ "license": "AGPL-3", "application": False, "installable": True, - "depends": ["contacts", "base_tier_validation", "partner_autocomplete"], + "depends": ["contacts", "base_tier_validation"], "data": [ "views/res_partner_view.xml", ], diff --git a/partner_tier_validation/models/__init__.py b/partner_tier_validation/models/__init__.py index 9253d4876d6..a415f52e719 100644 --- a/partner_tier_validation/models/__init__.py +++ b/partner_tier_validation/models/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2021 Open Source Integrators +# Copyright 2019 Open Source Integrators # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from . import res_partner diff --git a/partner_tier_validation/models/res_partner.py b/partner_tier_validation/models/res_partner.py index aeea2870a6f..df52d4b9fb3 100644 --- a/partner_tier_validation/models/res_partner.py +++ b/partner_tier_validation/models/res_partner.py @@ -1,10 +1,10 @@ -# Copyright 2021 Open Source Integrators +# Copyright 2019 Open Source Integrators # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import fields, models -class ResPartner11(models.Model): +class ResPartner(models.Model): _name = "res.partner" _inherit = ["res.partner", "tier.validation", "mail.activity.mixin"] _state_from = ["new", "to approve"] diff --git a/partner_tier_validation/models/tier_validation.py b/partner_tier_validation/models/tier_validation.py index 565cc1bb94f..a070e2ac1de 100644 --- a/partner_tier_validation/models/tier_validation.py +++ b/partner_tier_validation/models/tier_validation.py @@ -1,4 +1,4 @@ -# Copyright 2021 Open Source Integrators +# Copyright 2019 Open Source Integrators # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import api, models diff --git a/partner_tier_validation/views/res_partner_view.xml b/partner_tier_validation/views/res_partner_view.xml index f6675dc5bfc..053dbbb44a7 100644 --- a/partner_tier_validation/views/res_partner_view.xml +++ b/partner_tier_validation/views/res_partner_view.xml @@ -1,5 +1,5 @@ - From b42f570245324def6b6eea97915058e6c60309b0 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Wed, 3 Mar 2021 12:32:04 +0000 Subject: [PATCH 04/47] [UPD] Update partner_tier_validation.pot --- .../i18n/partner_tier_validation.pot | 211 ++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 partner_tier_validation/i18n/partner_tier_validation.pot diff --git a/partner_tier_validation/i18n/partner_tier_validation.pot b/partner_tier_validation/i18n/partner_tier_validation.pot new file mode 100644 index 00000000000..c8834fbab4e --- /dev/null +++ b/partner_tier_validation/i18n/partner_tier_validation.pot @@ -0,0 +1,211 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * partner_tier_validation +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: partner_tier_validation +#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier +msgid "" +"This partner needs to be\n" +" approved before it can have transactions." +msgstr "" + +#. module: partner_tier_validation +#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier +msgid "" +" Partner creation has been rejected." +msgstr "" + +#. module: partner_tier_validation +#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier +msgid "" +" Partner has been approved and now can have" +" transactions!" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_ids +msgid "Activities" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_exception_decoration +msgid "Activity Exception Decoration" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_state +msgid "Activity State" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_type_icon +msgid "Activity Type Icon" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields.selection,name:partner_tier_validation.selection__res_partner__state__approved +msgid "Approved" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__can_review +msgid "Can Review" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model,name:partner_tier_validation.model_res_partner +msgid "Contact" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__display_name +#: model:ir.model.fields,field_description:partner_tier_validation.field_tier_validation__display_name +msgid "Display Name" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,help:partner_tier_validation.field_res_partner__activity_type_icon +msgid "Font awesome icon e.g. fa-tasks" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__has_comment +msgid "Has Comment" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__id +#: model:ir.model.fields,field_description:partner_tier_validation.field_tier_validation__id +msgid "ID" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_exception_icon +msgid "Icon" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,help:partner_tier_validation.field_res_partner__activity_exception_icon +msgid "Icon to indicate an exception activity." +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner____last_update +#: model:ir.model.fields,field_description:partner_tier_validation.field_tier_validation____last_update +msgid "Last Modified on" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__need_validation +msgid "Need Validation" +msgstr "" + +#. module: partner_tier_validation +#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier_filter +msgid "Needs my Review" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields.selection,name:partner_tier_validation.selection__res_partner__state__new +msgid "New" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_date_deadline +msgid "Next Activity Deadline" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_summary +msgid "Next Activity Summary" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_type_id +msgid "Next Activity Type" +msgstr "" + +#. module: partner_tier_validation +#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier_filter +msgid "Partner(s) to review" +msgstr "" + +#. module: partner_tier_validation +#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier +msgid "Reject" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__rejected +msgid "Rejected" +msgstr "" + +#. module: partner_tier_validation +#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier +msgid "Request Validation" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_user_id +msgid "Responsible User" +msgstr "" + +#. module: partner_tier_validation +#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier +msgid "Restart Validation" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__reviewer_ids +msgid "Reviewers" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__state +msgid "Status" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,help:partner_tier_validation.field_res_partner__activity_state +msgid "" +"Status based on activities\n" +"Overdue: Due date is already passed\n" +"Today: Activity date is today\n" +"Planned: Future activities." +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model,name:partner_tier_validation.model_tier_validation +msgid "Tier Validation (abstract)" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,help:partner_tier_validation.field_res_partner__activity_exception_decoration +msgid "Type of the exception activity on record." +msgstr "" + +#. module: partner_tier_validation +#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier +msgid "Validate" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__validated +msgid "Validated" +msgstr "" + +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__review_ids +msgid "Validations" +msgstr "" From 88229b17cab36b1d7c0e1da5040289e1386443b4 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Wed, 24 Mar 2021 00:11:47 +0000 Subject: [PATCH 05/47] [FIX] partner_tier_validation: workflow was not working --- partner_tier_validation/__manifest__.py | 5 +- .../data/tier_definition.xml | 12 +++ partner_tier_validation/models/__init__.py | 2 +- partner_tier_validation/models/res_partner.py | 27 ++++- .../models/tier_definition.py | 14 +++ .../models/tier_validation.py | 58 ----------- .../readme/CONFIGURATION.rst | 10 ++ .../readme/CONTRIBUTORS.rst | 4 + .../readme/DESCRIPTION.rst | 5 + partner_tier_validation/readme/INSTALL.rst | 2 + partner_tier_validation/readme/USAGE.rst | 19 ++++ .../views/res_partner_view.xml | 98 +++---------------- 12 files changed, 106 insertions(+), 150 deletions(-) create mode 100644 partner_tier_validation/data/tier_definition.xml create mode 100644 partner_tier_validation/models/tier_definition.py delete mode 100644 partner_tier_validation/models/tier_validation.py create mode 100644 partner_tier_validation/readme/CONFIGURATION.rst create mode 100644 partner_tier_validation/readme/CONTRIBUTORS.rst create mode 100644 partner_tier_validation/readme/DESCRIPTION.rst create mode 100644 partner_tier_validation/readme/INSTALL.rst create mode 100644 partner_tier_validation/readme/USAGE.rst diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index c86cd1f144c..cb932174d6d 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -2,17 +2,16 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Partner Tier Validation", - "summary": "Extends the functionality of Contacts to" - "support a tier validation process.", + "summary": "Support a tier validation process for Contacts", "version": "14.0.1.0.0", "website": "https://github.com/OCA/partner-contact", "category": "Contact", "author": "Open Source Integrators, Odoo Community Association (OCA)", "license": "AGPL-3", - "application": False, "installable": True, "depends": ["contacts", "base_tier_validation"], "data": [ + "data/tier_definition.xml", "views/res_partner_view.xml", ], } diff --git a/partner_tier_validation/data/tier_definition.xml b/partner_tier_validation/data/tier_definition.xml new file mode 100644 index 00000000000..9d328db912e --- /dev/null +++ b/partner_tier_validation/data/tier_definition.xml @@ -0,0 +1,12 @@ + + + Partner Validation + + group + + domain + ["&",["parent_id","=",False],"|",["active","=",True],["active","=",False]] + + diff --git a/partner_tier_validation/models/__init__.py b/partner_tier_validation/models/__init__.py index a415f52e719..77a3f1dc96d 100644 --- a/partner_tier_validation/models/__init__.py +++ b/partner_tier_validation/models/__init__.py @@ -2,4 +2,4 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from . import res_partner -from . import tier_validation +from . import tier_definition diff --git a/partner_tier_validation/models/res_partner.py b/partner_tier_validation/models/res_partner.py index df52d4b9fb3..79464e0167b 100644 --- a/partner_tier_validation/models/res_partner.py +++ b/partner_tier_validation/models/res_partner.py @@ -1,15 +1,32 @@ # Copyright 2019 Open Source Integrators # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import fields, models +from odoo import api, fields, models class ResPartner(models.Model): _name = "res.partner" - _inherit = ["res.partner", "tier.validation", "mail.activity.mixin"] - _state_from = ["new", "to approve"] - _state_to = ["approved"] + _inherit = ["res.partner", "tier.validation"] + _tier_validation_manual_config = False state = fields.Selection( - [("new", "New"), ("approved", "Approved")], string="Status", default="new" + [("draft", "Draft"), ("confirmed", "Active"), ("cancel", "Archived")], + string="Status", + default="draft", ) + + @api.model + def create(self, vals): + new = super().create(vals) + if new.need_validation and new.state != "confirmed": + new.active = False + return new + + def write(self, vals): + """ + Default `active` is False. + It is set to True when State changes to confirmed. + """ + if "state" in vals: + vals["active"] = vals["state"] == "confirmed" + return super().write(vals) diff --git a/partner_tier_validation/models/tier_definition.py b/partner_tier_validation/models/tier_definition.py new file mode 100644 index 00000000000..c159d95b3eb --- /dev/null +++ b/partner_tier_validation/models/tier_definition.py @@ -0,0 +1,14 @@ +# Copyright 2019 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("res.partner") + return res diff --git a/partner_tier_validation/models/tier_validation.py b/partner_tier_validation/models/tier_validation.py deleted file mode 100644 index a070e2ac1de..00000000000 --- a/partner_tier_validation/models/tier_validation.py +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2019 Open Source Integrators -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -from odoo import api, models - - -class TierValidation(models.AbstractModel): - _inherit = "tier.validation" - - @api.model - def _get_under_validation_exceptions(self): - """Extend for more field exceptions.""" - res = super(TierValidation, self)._get_under_validation_exceptions() or [] - ex_fields = ["categ_id", "state", "customer", "supplier", "excise_tax"] - for val in ex_fields: - res.append(val) - return res - - def validate_tier(self): - super(TierValidation, self).validate_tier() - # make sure to only work with res.partner object. - if self._name != "res.partner": - return - for partner in self: - rec = self.env["tier.review"].search( - [("res_id", "=", partner.id), ("model", "=", "res.partner")] - ) - if rec and rec.status == "approved": - partner.state = "approved" - - # Need to override for Partner Tier Validation since can_review field - # is set to True based only - # if current user is a member of reviewer_ids. This can_review field - # is used to enable or disable the boolean - # field Is Customer / Is Vendor not only during the Validation process - # but even if it is in Approved State. - @api.depends("review_ids") - def _compute_reviewer_ids(self): - if str(self.__class__) == "": - for rec in self: - rec.reviewer_ids = rec.review_ids.filtered( - lambda r: r.status in ("pending", "approved") - ).mapped("reviewer_ids") - else: - for rec in self: - rec.reviewer_ids = rec.review_ids.filtered( - lambda r: r.status == "pending" - ).mapped("reviewer_ids") - - def request_validation(self): - res = super().request_validation() - for rec in self.filtered(lambda x: x._name == "res.partner"): - rec.message_subscribe( - partner_ids=[ - self.env.user.partner_id.id, - ] - ) - return res diff --git a/partner_tier_validation/readme/CONFIGURATION.rst b/partner_tier_validation/readme/CONFIGURATION.rst new file mode 100644 index 00000000000..f2c56d72eb7 --- /dev/null +++ b/partner_tier_validation/readme/CONFIGURATION.rst @@ -0,0 +1,10 @@ +The approval rules can be configured to suit particular use cases. +A default validation rule is provided out of the box, +that can be used as a starting point fot this configuration. + +This configuration is done at +*Settings > Technical > Tier Validations > Tier Definition*. + +Note that, since Contacts start as archived records, +the *Definition Domain* must include ``"|",["active","=",True],["active","=",False]``. +Otherwise the validation rule won't apply correctly in new records. diff --git a/partner_tier_validation/readme/CONTRIBUTORS.rst b/partner_tier_validation/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..3c78380fe95 --- /dev/null +++ b/partner_tier_validation/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Open Source Integrators `_. + + * Antonio Yamuta + * Daniel Reis diff --git a/partner_tier_validation/readme/DESCRIPTION.rst b/partner_tier_validation/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..3e383aee814 --- /dev/null +++ b/partner_tier_validation/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +Adds an approval workflow to Partners. +The default rule requires new parent Contacts to be approved +before they can be used. + +For this, the new Contact record is kept as "Archived" until it is approved. diff --git a/partner_tier_validation/readme/INSTALL.rst b/partner_tier_validation/readme/INSTALL.rst new file mode 100644 index 00000000000..638fbd2d688 --- /dev/null +++ b/partner_tier_validation/readme/INSTALL.rst @@ -0,0 +1,2 @@ +This module depends on ``base_tier_validation``. You can find it at +`OCA/server-ux `_ diff --git a/partner_tier_validation/readme/USAGE.rst b/partner_tier_validation/readme/USAGE.rst new file mode 100644 index 00000000000..40016f54a5b --- /dev/null +++ b/partner_tier_validation/readme/USAGE.rst @@ -0,0 +1,19 @@ +A regular user creates a new Contact and sends it for approval: + +#. Create a Contact triggering at least one "Tier Definition". + The Contact will be in Draft state and marked as Archived until approved. +#. Click on *Request Validation* button. +#. In the *Reviews* section, at the bottom of the form, inspect the pending reviews and their status. + + +The approver reviews Contacts to approve: + +#. Navigate to the Contacts app, and select the filter "Needs my Approval" +#. Open the Contact form to approve. It will display a + "This Records needs to be validated" banner, with "Validate" and "Reject" options. +#. The approver can change the state to "Active". + This will automatically unarchive the record and make it available to be used. + + +The Approve/Reject actions do not automatically change the State. +This could be a future improvement. diff --git a/partner_tier_validation/views/res_partner_view.xml b/partner_tier_validation/views/res_partner_view.xml index 053dbbb44a7..cc74dee53f6 100644 --- a/partner_tier_validation/views/res_partner_view.xml +++ b/partner_tier_validation/views/res_partner_view.xml @@ -1,4 +1,3 @@ - @@ -6,85 +5,18 @@ partner.form.tier res.partner - - - -
- -
-
+ + -
- - - - - - - -
- - + +
+ +
@@ -95,12 +27,12 @@ res.partner - + From aaf0ea1d70eeedef8d8fcd05080e9a1be490858c Mon Sep 17 00:00:00 2001 From: oca-travis Date: Wed, 7 Apr 2021 20:21:10 +0000 Subject: [PATCH 06/47] [UPD] Update partner_tier_validation.pot --- .../i18n/partner_tier_validation.pot | 129 ++---------------- 1 file changed, 15 insertions(+), 114 deletions(-) diff --git a/partner_tier_validation/i18n/partner_tier_validation.pot b/partner_tier_validation/i18n/partner_tier_validation.pot index c8834fbab4e..afda27cdfab 100644 --- a/partner_tier_validation/i18n/partner_tier_validation.pot +++ b/partner_tier_validation/i18n/partner_tier_validation.pot @@ -14,48 +14,13 @@ msgstr "" "Plural-Forms: \n" #. module: partner_tier_validation -#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier -msgid "" -"This partner needs to be\n" -" approved before it can have transactions." -msgstr "" - -#. module: partner_tier_validation -#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier -msgid "" -" Partner creation has been rejected." -msgstr "" - -#. module: partner_tier_validation -#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier -msgid "" -" Partner has been approved and now can have" -" transactions!" -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_ids -msgid "Activities" -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_exception_decoration -msgid "Activity Exception Decoration" +#: model:ir.model.fields.selection,name:partner_tier_validation.selection__res_partner__state__confirmed +msgid "Active" msgstr "" #. module: partner_tier_validation -#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_state -msgid "Activity State" -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_type_icon -msgid "Activity Type Icon" -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model.fields.selection,name:partner_tier_validation.selection__res_partner__state__approved -msgid "Approved" +#: model:ir.model.fields.selection,name:partner_tier_validation.selection__res_partner__state__cancel +msgid "Archived" msgstr "" #. module: partner_tier_validation @@ -70,13 +35,13 @@ msgstr "" #. module: partner_tier_validation #: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__display_name -#: model:ir.model.fields,field_description:partner_tier_validation.field_tier_validation__display_name +#: model:ir.model.fields,field_description:partner_tier_validation.field_tier_definition__display_name msgid "Display Name" msgstr "" #. module: partner_tier_validation -#: model:ir.model.fields,help:partner_tier_validation.field_res_partner__activity_type_icon -msgid "Font awesome icon e.g. fa-tasks" +#: model:ir.model.fields.selection,name:partner_tier_validation.selection__res_partner__state__draft +msgid "Draft" msgstr "" #. module: partner_tier_validation @@ -86,23 +51,13 @@ msgstr "" #. module: partner_tier_validation #: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__id -#: model:ir.model.fields,field_description:partner_tier_validation.field_tier_validation__id +#: model:ir.model.fields,field_description:partner_tier_validation.field_tier_definition__id msgid "ID" msgstr "" -#. module: partner_tier_validation -#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_exception_icon -msgid "Icon" -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model.fields,help:partner_tier_validation.field_res_partner__activity_exception_icon -msgid "Icon to indicate an exception activity." -msgstr "" - #. module: partner_tier_validation #: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner____last_update -#: model:ir.model.fields,field_description:partner_tier_validation.field_tier_validation____last_update +#: model:ir.model.fields,field_description:partner_tier_validation.field_tier_definition____last_update msgid "Last Modified on" msgstr "" @@ -113,37 +68,17 @@ msgstr "" #. module: partner_tier_validation #: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier_filter -msgid "Needs my Review" -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model.fields.selection,name:partner_tier_validation.selection__res_partner__state__new -msgid "New" -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_date_deadline -msgid "Next Activity Deadline" +msgid "Needs my Approval" msgstr "" #. module: partner_tier_validation -#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_summary -msgid "Next Activity Summary" -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_type_id -msgid "Next Activity Type" +#: model:tier.definition,name:partner_tier_validation.partner_tier_definition +msgid "Partner Validation" msgstr "" #. module: partner_tier_validation #: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier_filter -msgid "Partner(s) to review" -msgstr "" - -#. module: partner_tier_validation -#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier -msgid "Reject" +msgid "Partner(s) to Approve" msgstr "" #. module: partner_tier_validation @@ -151,21 +86,6 @@ msgstr "" msgid "Rejected" msgstr "" -#. module: partner_tier_validation -#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier -msgid "Request Validation" -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__activity_user_id -msgid "Responsible User" -msgstr "" - -#. module: partner_tier_validation -#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier -msgid "Restart Validation" -msgstr "" - #. module: partner_tier_validation #: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__reviewer_ids msgid "Reviewers" @@ -177,27 +97,8 @@ msgid "Status" msgstr "" #. module: partner_tier_validation -#: model:ir.model.fields,help:partner_tier_validation.field_res_partner__activity_state -msgid "" -"Status based on activities\n" -"Overdue: Due date is already passed\n" -"Today: Activity date is today\n" -"Planned: Future activities." -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model,name:partner_tier_validation.model_tier_validation -msgid "Tier Validation (abstract)" -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model.fields,help:partner_tier_validation.field_res_partner__activity_exception_decoration -msgid "Type of the exception activity on record." -msgstr "" - -#. module: partner_tier_validation -#: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier -msgid "Validate" +#: model:ir.model,name:partner_tier_validation.model_tier_definition +msgid "Tier Definition" msgstr "" #. module: partner_tier_validation From 587904478c409006008dbae108829fb8533ba8ce Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 7 Apr 2021 20:36:55 +0000 Subject: [PATCH 07/47] [UPD] README.rst --- partner_tier_validation/README.rst | 115 +++-- .../static/description/index.html | 453 ++++++++++++++++++ 2 files changed, 519 insertions(+), 49 deletions(-) create mode 100644 partner_tier_validation/static/description/index.html diff --git a/partner_tier_validation/README.rst b/partner_tier_validation/README.rst index c197ce0b704..855c4bb4357 100644 --- a/partner_tier_validation/README.rst +++ b/partner_tier_validation/README.rst @@ -1,92 +1,109 @@ -.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png - :target: https://www.gnu.org/licenses/agpl - :alt: License: AGPL-3 - ======================= Partner Tier Validation ======================= -This module extends the functionality of Partner to support a tier -validation process. +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -Installation -============ +.. |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%2Fpartner--contact-lightgray.png?logo=github + :target: https://github.com/OCA/partner-contact/tree/14.0/partner_tier_validation + :alt: OCA/partner-contact +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-partner_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/134/14.0 + :alt: Try me on Runbot -This module depends on ``base_tier_validation``. You can find it at -`OCA/server-ux `_ +|badge1| |badge2| |badge3| |badge4| |badge5| +Adds an approval workflow to Partners. +The default rule requires new parent Contacts to be approved +before they can be used. -Configuration -============= +For this, the new Contact record is kept as "Archived" until it is approved. -To configure this module, you need to: +**Table of contents** -#. Go to *Settings > Technical > Tier Validations > Tier Definition*. -#. Create as many tiers as you want for Contact model. -#. Example: - Definition Formula - Tier Definition Expression - # Available locals: - # - rec: current record +.. contents:: + :local: - [rec.state == New] +Installation +============ + +This module depends on ``base_tier_validation``. You can find it at +`OCA/server-ux `_ Usage ===== -To use this module, you need to: +A regular user creates a new Contact and sends it for approval: -#. Create a Contact triggering at least one "Tier Definition". +#. Create a Contact triggering at least one "Tier Definition". + The Contact will be in Draft state and marked as Archived until approved. #. Click on *Request Validation* button. -#. Under the tab *Reviews* have a look to pending reviews and their statuses. -#. Validator has to update Is Customer or Is Supplier or Both for this Contact to be usable on SO/PO. +#. In the *Reviews* section, at the bottom of the form, inspect the pending reviews and their status. -Additional features: -* You can filter the Invoices requesting your review through the filter *Needs my - Review*. -* User with rights to confirm the Vendor Bill (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. +The approver reviews Contacts to approve: -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/142/11.0 +#. Navigate to the Contacts app, and select the filter "Needs my Approval" +#. Open the Contact form to approve. It will display a + "This Records needs to be validated" banner, with "Validate" and "Reject" options. +#. The approver can change the state to "Active". + This will automatically unarchive the record and make it available to be used. + + +The Approve/Reject actions do not automatically change the State. +This could be a future improvement. Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smash it by providing detailed and welcomed feedback. +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* Open Source Integrators Contributors ------------- +~~~~~~~~~~~~ -* Antonio Yamuta +* `Open Source Integrators `_. -Do not contact contributors directly about support or help with technical issues. + * Antonio Yamuta + * Daniel Reis -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/partner-contact `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/partner_tier_validation/static/description/index.html b/partner_tier_validation/static/description/index.html new file mode 100644 index 00000000000..11eb1dd129e --- /dev/null +++ b/partner_tier_validation/static/description/index.html @@ -0,0 +1,453 @@ + + + + + + +Partner Tier Validation + + + +
+

Partner Tier Validation

+ + +

Beta License: AGPL-3 OCA/partner-contact Translate me on Weblate Try me on Runbot

+

Adds an approval workflow to Partners. +The default rule requires new parent Contacts to be approved +before they can be used.

+

For this, the new Contact record is kept as “Archived” until it is approved.

+

Table of contents

+ +
+

Installation

+

This module depends on base_tier_validation. You can find it at +OCA/server-ux

+
+
+

Usage

+

A regular user creates a new Contact and sends it for approval:

+
    +
  1. Create a Contact triggering at least one “Tier Definition”. +The Contact will be in Draft state and marked as Archived until approved.
  2. +
  3. Click on Request Validation button.
  4. +
  5. In the Reviews section, at the bottom of the form, inspect the pending reviews and their status.
  6. +
+

The approver reviews Contacts to approve:

+
    +
  1. Navigate to the Contacts app, and select the filter “Needs my Approval”
  2. +
  3. Open the Contact form to approve. It will display a +“This Records needs to be validated” banner, with “Validate” and “Reject” options.
  4. +
  5. The approver can change the state to “Active”. +This will automatically unarchive the record and make it available to be used.
  6. +
+

The Approve/Reject actions do not automatically change the State. +This could be a future improvement.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Open Source Integrators
  • +
+
+ +
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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/partner-contact project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + From e1b700d8c15d001c4f8ed254cd85c12714cb7ad7 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Wed, 7 Apr 2021 20:36:56 +0000 Subject: [PATCH 08/47] partner_tier_validation 14.0.1.1.0 --- partner_tier_validation/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index cb932174d6d..20cfa62907f 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Partner Tier Validation", "summary": "Support a tier validation process for Contacts", - "version": "14.0.1.0.0", + "version": "14.0.1.1.0", "website": "https://github.com/OCA/partner-contact", "category": "Contact", "author": "Open Source Integrators, Odoo Community Association (OCA)", From 25009eca0477a319a76c4343cffe8369c6532bd1 Mon Sep 17 00:00:00 2001 From: Patrick Wilson <36892066+patrickrwilson@users.noreply.github.com> Date: Wed, 19 May 2021 13:24:04 -0600 Subject: [PATCH 09/47] [IMP] - Added new optional tier definition for is_company = true. - Added auto active if no validation needed during create. - Added reset validation during write for specific fields. [FIX] Code White Space Formatting [IMP] Reviewer Suggestions [IMP] Added Tests --- .../data/tier_definition.xml | 6 +- partner_tier_validation/models/res_partner.py | 23 +++++-- .../readme/DESCRIPTION.rst | 9 ++- partner_tier_validation/tests/__init__.py | 3 + .../tests/test_tier_validation.py | 68 +++++++++++++++++++ 5 files changed, 101 insertions(+), 8 deletions(-) create mode 100644 partner_tier_validation/tests/__init__.py create mode 100644 partner_tier_validation/tests/test_tier_validation.py diff --git a/partner_tier_validation/data/tier_definition.xml b/partner_tier_validation/data/tier_definition.xml index 9d328db912e..4a5436fa030 100644 --- a/partner_tier_validation/data/tier_definition.xml +++ b/partner_tier_validation/data/tier_definition.xml @@ -1,12 +1,12 @@ - - Partner Validation + + Partner Validation (Company) group domain ["&",["parent_id","=",False],"|",["active","=",True],["active","=",False]] + >["&",["is_company","=",True],"|",["active","=",True],["active","=",False]] diff --git a/partner_tier_validation/models/res_partner.py b/partner_tier_validation/models/res_partner.py index 79464e0167b..34e78d17e22 100644 --- a/partner_tier_validation/models/res_partner.py +++ b/partner_tier_validation/models/res_partner.py @@ -15,18 +15,33 @@ class ResPartner(models.Model): default="draft", ) + @api.model + def _tier_revalidation_fields(self, values): + """ + Changing some Partner fields forces Tier Validation to be reevaluated. + Out of the box these are is_company and parent_id. + Other can be added extenting this method. + """ + return ["is_company", "parent_id"] + @api.model def create(self, vals): new = super().create(vals) if new.need_validation and new.state != "confirmed": new.active = False + else: + new.active = True + new.state = "confirmed" return new def write(self, vals): - """ - Default `active` is False. - It is set to True when State changes to confirmed. - """ + # Changing certain fields required new validation process + revalidate_fields = self._tier_revalidation_fields(vals) + if any(x in revalidate_fields for x in vals.keys()): + self.mapped("review_ids").unlink() + vals["state"] = "draft" + + # Automatically update active flag depending on state if "state" in vals: vals["active"] = vals["state"] == "confirmed" return super().write(vals) diff --git a/partner_tier_validation/readme/DESCRIPTION.rst b/partner_tier_validation/readme/DESCRIPTION.rst index 3e383aee814..fe2b83fe66f 100644 --- a/partner_tier_validation/readme/DESCRIPTION.rst +++ b/partner_tier_validation/readme/DESCRIPTION.rst @@ -1,5 +1,12 @@ Adds an approval workflow to Partners. -The default rule requires new parent Contacts to be approved +The default rule requires new company Contacts to be approved before they can be used. +The rule can be extended to new non-company contact, +but beware that may cause issues with automatically created new contacts, +such as the ones generated when processing incoming emails. + +If the 'Is Company' or 'Parent' field changes then the contact is Request +for approval. + For this, the new Contact record is kept as "Archived" until it is approved. diff --git a/partner_tier_validation/tests/__init__.py b/partner_tier_validation/tests/__init__.py new file mode 100644 index 00000000000..f39596410e7 --- /dev/null +++ b/partner_tier_validation/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_tier_validation diff --git a/partner_tier_validation/tests/test_tier_validation.py b/partner_tier_validation/tests/test_tier_validation.py new file mode 100644 index 00000000000..f4fe3d2214f --- /dev/null +++ b/partner_tier_validation/tests/test_tier_validation.py @@ -0,0 +1,68 @@ +# Copyright 2021 Patrick Wilson +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). + +from odoo.exceptions import ValidationError +from odoo.tests import common, tagged + + +@tagged("-at_install", "post_install") +class TestPartnerTierValidation(common.SavepointCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + # Get res partner model + cls.partner_model = cls.env.ref("base.model_res_partner") + + # Create users + group_ids = cls.env.ref("base.group_system").ids + group_ids.append(cls.env.ref("base.group_partner_manager").id) + cls.test_user_1 = cls.env["res.users"].create( + { + "name": "John", + "login": "test1", + "groups_id": [(6, 0, group_ids)], + "email": "test@examlple.com", + } + ) + + # Create tier definitions: + cls.tier_def_obj = cls.env["tier.definition"] + cls.tier_def_obj.create( + { + "model_id": cls.partner_model.id, + "review_type": "individual", + "reviewer_id": cls.test_user_1.id, + "definition_domain": "['&',('is_company','=',True),'|', \ + ('active','=',True),('active','=',False)]", + } + ) + + def test_tier_validation_model_name(self): + self.assertIn( + "res.partner", self.tier_def_obj._get_tier_validation_model_names() + ) + + def test_validation_res_partner(self): + company = self.env["res.partner"].create( + {"name": "Company for test", "company_type": "company"} + ) + # Since company need validation, it should be inactive + self.assertEqual(company.active, False) + + # Assert an error shows if trying to make it active + with self.assertRaises(ValidationError): + company.write({"state": "confirmed"}) + + # Request and validate partner + company.request_validation() + company.with_user(self.test_user_1).validate_tier() + company.with_user(self.test_user_1).write({"state": "confirmed"}) + self.assertEqual(company.state, "confirmed") + + # Change company type to retrigger validation + company.write({"company_type": "person", "is_company": False}) + self.assertEqual(company.state, "draft") + + # Test partner creation that doesn't need validation + customer = self.env["res.partner"].create({"name": "Partner for test"}) + self.assertEqual(customer.active, True) From 960d3ae6e1ecd5c73264a408cbdeb0b22f576272 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 28 May 2021 15:18:24 +0000 Subject: [PATCH 10/47] [UPD] Update partner_tier_validation.pot --- partner_tier_validation/i18n/partner_tier_validation.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/partner_tier_validation/i18n/partner_tier_validation.pot b/partner_tier_validation/i18n/partner_tier_validation.pot index afda27cdfab..fad014b945a 100644 --- a/partner_tier_validation/i18n/partner_tier_validation.pot +++ b/partner_tier_validation/i18n/partner_tier_validation.pot @@ -72,8 +72,8 @@ msgid "Needs my Approval" msgstr "" #. module: partner_tier_validation -#: model:tier.definition,name:partner_tier_validation.partner_tier_definition -msgid "Partner Validation" +#: model:tier.definition,name:partner_tier_validation.partner_tier_definition_company_only +msgid "Partner Validation (Company)" msgstr "" #. module: partner_tier_validation From 3c0e05594cbe1940116fcd6e23e18e43c560640c Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 28 May 2021 15:40:05 +0000 Subject: [PATCH 11/47] [UPD] README.rst --- partner_tier_validation/README.rst | 9 ++++++++- partner_tier_validation/static/description/index.html | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/partner_tier_validation/README.rst b/partner_tier_validation/README.rst index 855c4bb4357..3b43aa1b721 100644 --- a/partner_tier_validation/README.rst +++ b/partner_tier_validation/README.rst @@ -26,9 +26,16 @@ Partner Tier Validation |badge1| |badge2| |badge3| |badge4| |badge5| Adds an approval workflow to Partners. -The default rule requires new parent Contacts to be approved +The default rule requires new company Contacts to be approved before they can be used. +The rule can be extended to new non-company contact, +but beware that may cause issues with automatically created new contacts, +such as the ones generated when processing incoming emails. + +If the 'Is Company' or 'Parent' field changes then the contact is Request +for approval. + For this, the new Contact record is kept as "Archived" until it is approved. **Table of contents** diff --git a/partner_tier_validation/static/description/index.html b/partner_tier_validation/static/description/index.html index 11eb1dd129e..f9344437664 100644 --- a/partner_tier_validation/static/description/index.html +++ b/partner_tier_validation/static/description/index.html @@ -369,8 +369,13 @@

Partner Tier Validation

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/partner-contact Translate me on Weblate Try me on Runbot

Adds an approval workflow to Partners. -The default rule requires new parent Contacts to be approved +The default rule requires new company Contacts to be approved before they can be used.

+

The rule can be extended to new non-company contact, +but beware that may cause issues with automatically created new contacts, +such as the ones generated when processing incoming emails.

+

If the ‘Is Company’ or ‘Parent’ field changes then the contact is Request +for approval.

For this, the new Contact record is kept as “Archived” until it is approved.

Table of contents

From d249b2bcce770c93446e0ff590af7ae086db86b7 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 28 May 2021 15:40:06 +0000 Subject: [PATCH 12/47] partner_tier_validation 14.0.2.0.0 --- partner_tier_validation/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index 20cfa62907f..8321c7d0aa5 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Partner Tier Validation", "summary": "Support a tier validation process for Contacts", - "version": "14.0.1.1.0", + "version": "14.0.2.0.0", "website": "https://github.com/OCA/partner-contact", "category": "Contact", "author": "Open Source Integrators, Odoo Community Association (OCA)", From dae5eada99af0b671d184870f22f3dc112eacf56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Mon, 11 Oct 2021 08:55:57 +0200 Subject: [PATCH 13/47] [FIX] partner_tier_validation: Defer rule activation for compatibility Having this rule activated by default in tests environments makes other tests to fail due to the additional constraint not expected by them, so what we are doing is: - Having the rule deactivated by default. - On a post-init hook, we activate it only if we are not in a test environment. - On own modules tests, we activate it as well TT30292 --- partner_tier_validation/__init__.py | 1 + partner_tier_validation/__manifest__.py | 1 + .../data/tier_definition.xml | 1 + partner_tier_validation/hooks.py | 18 ++++++++++++++++++ 4 files changed, 21 insertions(+) create mode 100644 partner_tier_validation/hooks.py diff --git a/partner_tier_validation/__init__.py b/partner_tier_validation/__init__.py index 31660d6a965..c0d9f3d12f7 100644 --- a/partner_tier_validation/__init__.py +++ b/partner_tier_validation/__init__.py @@ -1,3 +1,4 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from . import models +from .hooks import post_init_hook diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index 8321c7d0aa5..7b2ca7f1fce 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -14,4 +14,5 @@ "data/tier_definition.xml", "views/res_partner_view.xml", ], + "post_init_hook": "post_init_hook", } diff --git a/partner_tier_validation/data/tier_definition.xml b/partner_tier_validation/data/tier_definition.xml index 4a5436fa030..528842bca4c 100644 --- a/partner_tier_validation/data/tier_definition.xml +++ b/partner_tier_validation/data/tier_definition.xml @@ -5,6 +5,7 @@ group domain + ["&",["is_company","=",True],"|",["active","=",True],["active","=",False]] diff --git a/partner_tier_validation/hooks.py b/partner_tier_validation/hooks.py new file mode 100644 index 00000000000..0bfebf1851b --- /dev/null +++ b/partner_tier_validation/hooks.py @@ -0,0 +1,18 @@ +# Copyright 2021 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import SUPERUSER_ID +from odoo.api import Environment +from odoo.tools import config + + +def post_init_hook(cr, pool): + """ + We need to activate the rule only if we are not in a test environment. + """ + if not config["test_enable"]: + env = Environment(cr, SUPERUSER_ID, {}) + tier_partner = env.ref( + "partner_tier_validation.partner_tier_definition_company_only" + ) + tier_partner.write({"active": True}) From 6669ce7bddf0d664ecb08b2d6cfc665e49042583 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Thu, 11 Nov 2021 07:13:57 +0000 Subject: [PATCH 14/47] [UPD] Update partner_tier_validation.pot --- partner_tier_validation/i18n/partner_tier_validation.pot | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/partner_tier_validation/i18n/partner_tier_validation.pot b/partner_tier_validation/i18n/partner_tier_validation.pot index fad014b945a..9bcf7072f05 100644 --- a/partner_tier_validation/i18n/partner_tier_validation.pot +++ b/partner_tier_validation/i18n/partner_tier_validation.pot @@ -71,6 +71,11 @@ msgstr "" msgid "Needs my Approval" msgstr "" +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__next_review +msgid "Next Review" +msgstr "" + #. module: partner_tier_validation #: model:tier.definition,name:partner_tier_validation.partner_tier_definition_company_only msgid "Partner Validation (Company)" From 3c3144a28109ca7a75492e80cead52b010cc863c Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Tue, 1 Feb 2022 13:57:32 +0000 Subject: [PATCH 15/47] [REF] partner_tier_validation: do not archive, depend on partner_stage --- partner_tier_validation/__init__.py | 2 - partner_tier_validation/__manifest__.py | 4 +- .../data/tier_definition.xml | 6 +-- partner_tier_validation/hooks.py | 18 ------- partner_tier_validation/models/res_partner.py | 41 +++++++++------- .../tests/test_tier_validation.py | 47 +++++++++++-------- .../views/res_partner_view.xml | 16 ++----- 7 files changed, 60 insertions(+), 74 deletions(-) delete mode 100644 partner_tier_validation/hooks.py diff --git a/partner_tier_validation/__init__.py b/partner_tier_validation/__init__.py index c0d9f3d12f7..3275ac2adf3 100644 --- a/partner_tier_validation/__init__.py +++ b/partner_tier_validation/__init__.py @@ -1,4 +1,2 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - from . import models -from .hooks import post_init_hook diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index 7b2ca7f1fce..5836fb6526f 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -9,10 +9,10 @@ "author": "Open Source Integrators, Odoo Community Association (OCA)", "license": "AGPL-3", "installable": True, - "depends": ["contacts", "base_tier_validation"], + "depends": ["contacts", "base_tier_validation", "partner_stage"], "data": [ "data/tier_definition.xml", "views/res_partner_view.xml", ], - "post_init_hook": "post_init_hook", + "maintainers": ["dreispt"], } diff --git a/partner_tier_validation/data/tier_definition.xml b/partner_tier_validation/data/tier_definition.xml index 528842bca4c..c46c0e54adc 100644 --- a/partner_tier_validation/data/tier_definition.xml +++ b/partner_tier_validation/data/tier_definition.xml @@ -1,13 +1,11 @@ - Partner Validation (Company) + Validate New Company group domain - ["&",["is_company","=",True],"|",["active","=",True],["active","=",False]] + [["is_company","=",True]] diff --git a/partner_tier_validation/hooks.py b/partner_tier_validation/hooks.py deleted file mode 100644 index 0bfebf1851b..00000000000 --- a/partner_tier_validation/hooks.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2021 Tecnativa - Víctor Martínez -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). - -from odoo import SUPERUSER_ID -from odoo.api import Environment -from odoo.tools import config - - -def post_init_hook(cr, pool): - """ - We need to activate the rule only if we are not in a test environment. - """ - if not config["test_enable"]: - env = Environment(cr, SUPERUSER_ID, {}) - tier_partner = env.ref( - "partner_tier_validation.partner_tier_definition_company_only" - ) - tier_partner.write({"active": True}) diff --git a/partner_tier_validation/models/res_partner.py b/partner_tier_validation/models/res_partner.py index 34e78d17e22..909085098e3 100644 --- a/partner_tier_validation/models/res_partner.py +++ b/partner_tier_validation/models/res_partner.py @@ -1,47 +1,54 @@ # Copyright 2019 Open Source Integrators # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo import api, fields, models +from odoo import api, models class ResPartner(models.Model): _name = "res.partner" _inherit = ["res.partner", "tier.validation"] - _tier_validation_manual_config = False - state = fields.Selection( - [("draft", "Draft"), ("confirmed", "Active"), ("cancel", "Archived")], - string="Status", - default="draft", - ) + _tier_validation_buttons_xpath = "/form/header/field[@name='state']" + _state_from = ["draft"] + _state_to = ["confirmed"] + _cancel_state = ["inactive"] + _tier_validation_manual_config = False @api.model def _tier_revalidation_fields(self, values): """ Changing some Partner fields forces Tier Validation to be reevaluated. Out of the box these are is_company and parent_id. - Other can be added extenting this method. + Other can be added extending this method. """ return ["is_company", "parent_id"] + @api.model + def _get_confirmed_stage(self): + return self.env["res.partner.stage"].search( + [("state", "in", self._state_to)], limit=1 + ) + @api.model def create(self, vals): new = super().create(vals) - if new.need_validation and new.state != "confirmed": - new.active = False - else: - new.active = True - new.state = "confirmed" + # Contact not requiring validation + # are created in confirmed state + if not new.need_validation: + confirmed_stage = self._get_confirmed_stage() + new.stage_id = confirmed_stage return new def write(self, vals): + # Signal state transition by adding to vals + if "stage_id" in vals: + stage_id = vals.get("stage_id") + stage = self.env["res.partner.stage"].browse(stage_id) + vals["state"] = stage.state # Changing certain fields required new validation process revalidate_fields = self._tier_revalidation_fields(vals) if any(x in revalidate_fields for x in vals.keys()): self.mapped("review_ids").unlink() vals["state"] = "draft" - - # Automatically update active flag depending on state - if "state" in vals: - vals["active"] = vals["state"] == "confirmed" + self.request_validation() return super().write(vals) diff --git a/partner_tier_validation/tests/test_tier_validation.py b/partner_tier_validation/tests/test_tier_validation.py index f4fe3d2214f..56420cfcf6d 100644 --- a/partner_tier_validation/tests/test_tier_validation.py +++ b/partner_tier_validation/tests/test_tier_validation.py @@ -21,48 +21,55 @@ def setUpClass(cls): "name": "John", "login": "test1", "groups_id": [(6, 0, group_ids)], - "email": "test@examlple.com", + "email": "test@example.com", } ) - # Create tier definitions: - cls.tier_def_obj = cls.env["tier.definition"] - cls.tier_def_obj.create( + # Create tier definition: example where only Company needs validation + cls.TierDefinition = cls.env["tier.definition"] + cls.TierDefinition.create( { "model_id": cls.partner_model.id, "review_type": "individual", "reviewer_id": cls.test_user_1.id, - "definition_domain": "['&',('is_company','=',True),'|', \ - ('active','=',True),('active','=',False)]", + "definition_domain": "[('is_company','=',True)]", } ) def test_tier_validation_model_name(self): self.assertIn( - "res.partner", self.tier_def_obj._get_tier_validation_model_names() + "res.partner", self.TierDefinition._get_tier_validation_model_names() ) def test_validation_res_partner(self): - company = self.env["res.partner"].create( + """ + Case where new Contact requires validation + """ + contact = self.env["res.partner"].create( {"name": "Company for test", "company_type": "company"} ) - # Since company need validation, it should be inactive - self.assertEqual(company.active, False) + # Since contact need validation, it should be inactive + self.assertEqual(contact.state, "draft") # Assert an error shows if trying to make it active with self.assertRaises(ValidationError): - company.write({"state": "confirmed"}) + contact.write({"state": "confirmed"}) # Request and validate partner - company.request_validation() - company.with_user(self.test_user_1).validate_tier() - company.with_user(self.test_user_1).write({"state": "confirmed"}) - self.assertEqual(company.state, "confirmed") + contact.request_validation() + contact.with_user(self.test_user_1).validate_tier() + contact.with_user(self.test_user_1).write({"state": "confirmed"}) + self.assertEqual(contact.state, "confirmed") # Change company type to retrigger validation - company.write({"company_type": "person", "is_company": False}) - self.assertEqual(company.state, "draft") + contact.write({"company_type": "person", "is_company": False}) + self.assertEqual(contact.state, "draft") - # Test partner creation that doesn't need validation - customer = self.env["res.partner"].create({"name": "Partner for test"}) - self.assertEqual(customer.active, True) + def test_no_validation_res_partner(self): + """ + Case where new Contact does not require validation + """ + contact = self.env["res.partner"].create( + {"name": "Person for test", "company_type": "person"} + ) + self.assertEqual(contact.state, "confirmed") diff --git a/partner_tier_validation/views/res_partner_view.xml b/partner_tier_validation/views/res_partner_view.xml index cc74dee53f6..29cbd0a62be 100644 --- a/partner_tier_validation/views/res_partner_view.xml +++ b/partner_tier_validation/views/res_partner_view.xml @@ -8,16 +8,10 @@ - -
- -
-
+ + + + @@ -31,7 +25,7 @@ From 13506b8178ec34cb1b42c2bd034c5d75da1f7653 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Thu, 17 Feb 2022 23:15:58 +0000 Subject: [PATCH 16/47] [UPD] Update partner_tier_validation.pot --- .../i18n/partner_tier_validation.pot | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/partner_tier_validation/i18n/partner_tier_validation.pot b/partner_tier_validation/i18n/partner_tier_validation.pot index 9bcf7072f05..aa60a9a0b0d 100644 --- a/partner_tier_validation/i18n/partner_tier_validation.pot +++ b/partner_tier_validation/i18n/partner_tier_validation.pot @@ -13,16 +13,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: partner_tier_validation -#: model:ir.model.fields.selection,name:partner_tier_validation.selection__res_partner__state__confirmed -msgid "Active" -msgstr "" - -#. module: partner_tier_validation -#: model:ir.model.fields.selection,name:partner_tier_validation.selection__res_partner__state__cancel -msgid "Archived" -msgstr "" - #. module: partner_tier_validation #: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__can_review msgid "Can Review" @@ -39,11 +29,6 @@ msgstr "" msgid "Display Name" msgstr "" -#. module: partner_tier_validation -#: model:ir.model.fields.selection,name:partner_tier_validation.selection__res_partner__state__draft -msgid "Draft" -msgstr "" - #. module: partner_tier_validation #: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__has_comment msgid "Has Comment" From 6eaea440b0faca41103e625808ad53e57d154be4 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Thu, 24 Feb 2022 15:07:19 +0000 Subject: [PATCH 17/47] [UPD] Update partner_tier_validation.pot --- .../i18n/partner_tier_validation.pot | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/partner_tier_validation/i18n/partner_tier_validation.pot b/partner_tier_validation/i18n/partner_tier_validation.pot index aa60a9a0b0d..2e5dfbc05ed 100644 --- a/partner_tier_validation/i18n/partner_tier_validation.pot +++ b/partner_tier_validation/i18n/partner_tier_validation.pot @@ -61,11 +61,6 @@ msgstr "" msgid "Next Review" msgstr "" -#. module: partner_tier_validation -#: model:tier.definition,name:partner_tier_validation.partner_tier_definition_company_only -msgid "Partner Validation (Company)" -msgstr "" - #. module: partner_tier_validation #: model_terms:ir.ui.view,arch_db:partner_tier_validation.partner_form_tier_filter msgid "Partner(s) to Approve" @@ -82,13 +77,13 @@ msgid "Reviewers" msgstr "" #. module: partner_tier_validation -#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__state -msgid "Status" +#: model:ir.model,name:partner_tier_validation.model_tier_definition +msgid "Tier Definition" msgstr "" #. module: partner_tier_validation -#: model:ir.model,name:partner_tier_validation.model_tier_definition -msgid "Tier Definition" +#: model:tier.definition,name:partner_tier_validation.partner_tier_definition_company_only +msgid "Validate New Company" msgstr "" #. module: partner_tier_validation From 231a9bc462a4d0f2ce0a7d9d58a89663b1ed54f7 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 24 Feb 2022 15:31:59 +0000 Subject: [PATCH 18/47] [UPD] README.rst --- partner_tier_validation/README.rst | 8 ++++++++ partner_tier_validation/static/description/index.html | 2 ++ 2 files changed, 10 insertions(+) diff --git a/partner_tier_validation/README.rst b/partner_tier_validation/README.rst index 3b43aa1b721..777f7887dbd 100644 --- a/partner_tier_validation/README.rst +++ b/partner_tier_validation/README.rst @@ -111,6 +111,14 @@ 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. +.. |maintainer-dreispt| image:: https://github.com/dreispt.png?size=40px + :target: https://github.com/dreispt + :alt: dreispt + +Current `maintainer `__: + +|maintainer-dreispt| + This module is part of the `OCA/partner-contact `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/partner_tier_validation/static/description/index.html b/partner_tier_validation/static/description/index.html index f9344437664..a247d0b51b4 100644 --- a/partner_tier_validation/static/description/index.html +++ b/partner_tier_validation/static/description/index.html @@ -449,6 +449,8 @@

Maintainers

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.

+

Current maintainer:

+

dreispt

This module is part of the OCA/partner-contact project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

From 28152d194e3b57d5f0e539474e8b4db9f16c4bae Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 24 Feb 2022 15:32:00 +0000 Subject: [PATCH 19/47] partner_tier_validation 14.0.3.0.0 --- partner_tier_validation/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index 5836fb6526f..b4d410d31d5 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Partner Tier Validation", "summary": "Support a tier validation process for Contacts", - "version": "14.0.2.0.0", + "version": "14.0.3.0.0", "website": "https://github.com/OCA/partner-contact", "category": "Contact", "author": "Open Source Integrators, Odoo Community Association (OCA)", From 01e800fece3dac6756962083a5e19de1f1174f9c Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Thu, 24 Feb 2022 18:54:22 +0000 Subject: [PATCH 20/47] [FIX] partner_tier_validation: create does not need custom code, restart validation on controlled field changes --- partner_tier_validation/models/res_partner.py | 46 +++++++++---------- .../readme/CONFIGURATION.rst | 22 +++++++-- partner_tier_validation/readme/USAGE.rst | 5 ++ 3 files changed, 44 insertions(+), 29 deletions(-) diff --git a/partner_tier_validation/models/res_partner.py b/partner_tier_validation/models/res_partner.py index 909085098e3..e364918d96e 100644 --- a/partner_tier_validation/models/res_partner.py +++ b/partner_tier_validation/models/res_partner.py @@ -15,40 +15,36 @@ class ResPartner(models.Model): _tier_validation_manual_config = False @api.model - def _tier_revalidation_fields(self, values): + def _partner_tier_revalidation_fields(self, values): """ Changing some Partner fields forces Tier Validation to be reevaluated. Out of the box these are is_company and parent_id. Other can be added extending this method. """ - return ["is_company", "parent_id"] - - @api.model - def _get_confirmed_stage(self): - return self.env["res.partner.stage"].search( - [("state", "in", self._state_to)], limit=1 - ) - - @api.model - def create(self, vals): - new = super().create(vals) - # Contact not requiring validation - # are created in confirmed state - if not new.need_validation: - confirmed_stage = self._get_confirmed_stage() - new.stage_id = confirmed_stage - return new + # IDEA: make it a System Parameter? + return [ + "company_type", + "parent_id", + "vat", + "state_id", + "country_id", + "property_account_position_id", + "property_account_receivable_id", + "property_account_payable_id", + ] def write(self, vals): - # Signal state transition by adding to vals + # Tier Validation does not work woith Stages, only States :-( + # So, signal state transition by adding it to the vals if "stage_id" in vals: stage_id = vals.get("stage_id") stage = self.env["res.partner.stage"].browse(stage_id) vals["state"] = stage.state - # Changing certain fields required new validation process - revalidate_fields = self._tier_revalidation_fields(vals) + # Changing certain fields requiresd a new validation process + revalidate_fields = self._partner_tier_revalidation_fields(vals) if any(x in revalidate_fields for x in vals.keys()): - self.mapped("review_ids").unlink() - vals["state"] = "draft" - self.request_validation() - return super().write(vals) + vals["stage_id"] = self._get_default_stage_id().id + res = super().write(vals) + if "stage_id" in vals: + self.restart_validation() + return res diff --git a/partner_tier_validation/readme/CONFIGURATION.rst b/partner_tier_validation/readme/CONFIGURATION.rst index f2c56d72eb7..12f37af2d2f 100644 --- a/partner_tier_validation/readme/CONFIGURATION.rst +++ b/partner_tier_validation/readme/CONFIGURATION.rst @@ -3,8 +3,22 @@ A default validation rule is provided out of the box, that can be used as a starting point fot this configuration. This configuration is done at -*Settings > Technical > Tier Validations > Tier Definition*. +*Settings / Technical / Tier Validations / Tier Definition*. -Note that, since Contacts start as archived records, -the *Definition Domain* must include ``"|",["active","=",True],["active","=",False]``. -Otherwise the validation rule won't apply correctly in new records. +Also relevant is the configuration on the default Stage +for new Contacts/Partners. +This can be set at *Contacts / Configuration / Contact Stage*, +setting the "Default Sate" field on the appropriate Stage record. + +Changing some fields will trigger a new request for validation. +This list of fields can be customized extending ``_partner_tier_revalidation_fields``. +By default these fields are: + +- Company Type (Individual or Company) +- Parent Company +- Tax ID +- State +- Country +- Fiscal Position +- Account Receivable +- Account Payable diff --git a/partner_tier_validation/readme/USAGE.rst b/partner_tier_validation/readme/USAGE.rst index 40016f54a5b..fb81ae01d5c 100644 --- a/partner_tier_validation/readme/USAGE.rst +++ b/partner_tier_validation/readme/USAGE.rst @@ -1,3 +1,8 @@ +Before using, check Contact Stages configuration, +to ensure that the default stage has the "Related State" field +set to "To Approve". +For example, having the "Draft" stage the default ensures this. + A regular user creates a new Contact and sends it for approval: #. Create a Contact triggering at least one "Tier Definition". From 773e025323f2ea8c9d75211adf35656a55ae4463 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Thu, 3 Mar 2022 09:29:20 +0000 Subject: [PATCH 21/47] [FIX] partner_tier_validation: fix tests --- partner_tier_validation/models/res_partner.py | 12 ++-- .../tests/test_tier_validation.py | 68 ++++++++++++------- 2 files changed, 50 insertions(+), 30 deletions(-) diff --git a/partner_tier_validation/models/res_partner.py b/partner_tier_validation/models/res_partner.py index e364918d96e..9c251a9582d 100644 --- a/partner_tier_validation/models/res_partner.py +++ b/partner_tier_validation/models/res_partner.py @@ -34,16 +34,16 @@ def _partner_tier_revalidation_fields(self, values): ] def write(self, vals): - # Tier Validation does not work woith Stages, only States :-( - # So, signal state transition by adding it to the vals + # Changing certain fields requires a new validation process + revalidate_fields = self._partner_tier_revalidation_fields(vals) + if any(x in revalidate_fields for x in vals.keys()): + vals["stage_id"] = self._get_default_stage_id().id + # Tier Validation does not work with Stages, only States :-( + # Workaround is to signal state transition adding it to the write values if "stage_id" in vals: stage_id = vals.get("stage_id") stage = self.env["res.partner.stage"].browse(stage_id) vals["state"] = stage.state - # Changing certain fields requiresd a new validation process - revalidate_fields = self._partner_tier_revalidation_fields(vals) - if any(x in revalidate_fields for x in vals.keys()): - vals["stage_id"] = self._get_default_stage_id().id res = super().write(vals) if "stage_id" in vals: self.restart_validation() diff --git a/partner_tier_validation/tests/test_tier_validation.py b/partner_tier_validation/tests/test_tier_validation.py index 56420cfcf6d..1a556b5763f 100644 --- a/partner_tier_validation/tests/test_tier_validation.py +++ b/partner_tier_validation/tests/test_tier_validation.py @@ -10,18 +10,25 @@ class TestPartnerTierValidation(common.SavepointCase): @classmethod def setUpClass(cls): super().setUpClass() - # Get res partner model - cls.partner_model = cls.env.ref("base.model_res_partner") - # Create users - group_ids = cls.env.ref("base.group_system").ids - group_ids.append(cls.env.ref("base.group_partner_manager").id) - cls.test_user_1 = cls.env["res.users"].create( + group_user = cls.env.ref("base.group_user") + group_contacts = cls.env.ref("base.group_partner_manager") + group_approver = cls.env.ref("base.group_no_one") + User = cls.env["res.users"] + cls.user_employee = User.create( + { + "name": "Employee", + "login": "empl1", + "email": "empl1@example.com", + "groups_id": (group_user | group_contacts).ids, + } + ) + cls.user_approver = User.create( { - "name": "John", - "login": "test1", - "groups_id": [(6, 0, group_ids)], - "email": "test@example.com", + "name": "Approver", + "login": "aprov1", + "email": "approv1@example.com", + "groups_id": (group_user | group_contacts | group_approver).ids, } ) @@ -29,13 +36,20 @@ def setUpClass(cls): cls.TierDefinition = cls.env["tier.definition"] cls.TierDefinition.create( { - "model_id": cls.partner_model.id, + "model_id": cls.env.ref("base.model_res_partner").id, "review_type": "individual", - "reviewer_id": cls.test_user_1.id, + "reviewer_id": cls.user_approver.id, "definition_domain": "[('is_company','=',True)]", } ) + # Setup Contact Stages: draft is the default + Stage = cls.env["res.partner.stage"] + Stage.search([("is_default", "=", True)]).write({"is_default": False}) + cls.stage_draft = Stage.search([("state", "=", "draft")], limit=1) + cls.stage_draft.is_default = True + cls.stage_confirmed = Stage.search([("state", "=", "confirmed")], limit=1) + def test_tier_validation_model_name(self): self.assertIn( "res.partner", self.TierDefinition._get_tier_validation_model_names() @@ -45,31 +59,37 @@ def test_validation_res_partner(self): """ Case where new Contact requires validation """ - contact = self.env["res.partner"].create( - {"name": "Company for test", "company_type": "company"} - ) - # Since contact need validation, it should be inactive + Partner = self.env["res.partner"] + contact_vals = {"name": "Company for test", "company_type": "company"} + contact = Partner.with_user(self.user_employee).create(contact_vals) self.assertEqual(contact.state, "draft") # Assert an error shows if trying to make it active with self.assertRaises(ValidationError): - contact.write({"state": "confirmed"}) + contact.write({"stage_id": self.stage_confirmed.id}) # Request and validate partner contact.request_validation() - contact.with_user(self.test_user_1).validate_tier() - contact.with_user(self.test_user_1).write({"state": "confirmed"}) + contact.with_user(self.user_approver).validate_tier() + contact.with_user(self.user_approver).write( + {"stage_id": self.stage_confirmed.id} + ) self.assertEqual(contact.state, "confirmed") # Change company type to retrigger validation - contact.write({"company_type": "person", "is_company": False}) - self.assertEqual(contact.state, "draft") + contact.write({"company_type": "person"}) + self.assertEqual( + contact.state, "draft", "Change company type sets back to draft" + ) def test_no_validation_res_partner(self): """ Case where new Contact does not require validation """ - contact = self.env["res.partner"].create( - {"name": "Person for test", "company_type": "person"} - ) + Partner = self.env["res.partner"] + contact_vals = {"name": "Company for test", "company_type": "person"} + contact = Partner.with_user(self.user_employee).create(contact_vals) + self.assertEqual(contact.state, "draft") + # Can move to confirmed state without approval + contact.write({"stage_id": self.stage_confirmed.id}) self.assertEqual(contact.state, "confirmed") From c1e0e3f6217f157fd3a2026c9571e4904fcce5fe Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 4 Mar 2022 19:19:13 +0000 Subject: [PATCH 22/47] [UPD] README.rst --- partner_tier_validation/README.rst | 5 +++++ partner_tier_validation/static/description/index.html | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/partner_tier_validation/README.rst b/partner_tier_validation/README.rst index 777f7887dbd..b7b6df80689 100644 --- a/partner_tier_validation/README.rst +++ b/partner_tier_validation/README.rst @@ -52,6 +52,11 @@ This module depends on ``base_tier_validation``. You can find it at Usage ===== +Before using, check Contact Stages configuration, +to ensure that the default stage has the "Related State" field +set to "To Approve". +For example, having the "Draft" stage the default ensures this. + A regular user creates a new Contact and sends it for approval: #. Create a Contact triggering at least one "Tier Definition". diff --git a/partner_tier_validation/static/description/index.html b/partner_tier_validation/static/description/index.html index a247d0b51b4..156e0855771 100644 --- a/partner_tier_validation/static/description/index.html +++ b/partner_tier_validation/static/description/index.html @@ -398,6 +398,10 @@

Installation

Usage

+

Before using, check Contact Stages configuration, +to ensure that the default stage has the “Related State” field +set to “To Approve”. +For example, having the “Draft” stage the default ensures this.

A regular user creates a new Contact and sends it for approval:

  1. Create a Contact triggering at least one “Tier Definition”. From 9798325e0affb9c79376b270be108e0fe27fbf6c Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 4 Mar 2022 19:19:13 +0000 Subject: [PATCH 23/47] partner_tier_validation 14.0.3.0.1 --- partner_tier_validation/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index b4d410d31d5..cdae869dc58 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Partner Tier Validation", "summary": "Support a tier validation process for Contacts", - "version": "14.0.3.0.0", + "version": "14.0.3.0.1", "website": "https://github.com/OCA/partner-contact", "category": "Contact", "author": "Open Source Integrators, Odoo Community Association (OCA)", From f2bd98e7f257e87e26b142a3ab7c25d0656aa27e Mon Sep 17 00:00:00 2001 From: oca-travis Date: Tue, 26 Apr 2022 08:50:40 +0000 Subject: [PATCH 24/47] [UPD] Update partner_tier_validation.pot --- .../i18n/partner_tier_validation.pot | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/partner_tier_validation/i18n/partner_tier_validation.pot b/partner_tier_validation/i18n/partner_tier_validation.pot index 2e5dfbc05ed..47604053c3e 100644 --- a/partner_tier_validation/i18n/partner_tier_validation.pot +++ b/partner_tier_validation/i18n/partner_tier_validation.pot @@ -71,6 +71,11 @@ msgstr "" msgid "Rejected" msgstr "" +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__rejected_message +msgid "Rejected Message" +msgstr "" + #. module: partner_tier_validation #: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__reviewer_ids msgid "Reviewers" @@ -81,6 +86,11 @@ msgstr "" msgid "Tier Definition" msgstr "" +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__to_validate_message +msgid "To Validate Message" +msgstr "" + #. module: partner_tier_validation #: model:tier.definition,name:partner_tier_validation.partner_tier_definition_company_only msgid "Validate New Company" @@ -91,6 +101,11 @@ msgstr "" msgid "Validated" msgstr "" +#. module: partner_tier_validation +#: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__validated_message +msgid "Validated Message" +msgstr "" + #. module: partner_tier_validation #: model:ir.model.fields,field_description:partner_tier_validation.field_res_partner__review_ids msgid "Validations" From 1d43a41ca94ae5e510ff114df60fd121b6c47c6b Mon Sep 17 00:00:00 2001 From: Patrick Wilson <36892066+patrickrwilson@users.noreply.github.com> Date: Wed, 27 Apr 2022 16:21:53 -0400 Subject: [PATCH 25/47] [IMP] partner_tier_validation (Prevent bypass) This prevents a scenario where a user can bypass validation by moving the partner to a 'cancel' stage and then moving it back to confirmed. --- partner_tier_validation/models/res_partner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/partner_tier_validation/models/res_partner.py b/partner_tier_validation/models/res_partner.py index 9c251a9582d..3b303bf4b4e 100644 --- a/partner_tier_validation/models/res_partner.py +++ b/partner_tier_validation/models/res_partner.py @@ -9,7 +9,7 @@ class ResPartner(models.Model): _inherit = ["res.partner", "tier.validation"] _tier_validation_buttons_xpath = "/form/header/field[@name='state']" - _state_from = ["draft"] + _state_from = ["draft", "cancel"] _state_to = ["confirmed"] _cancel_state = ["inactive"] _tier_validation_manual_config = False @@ -45,6 +45,6 @@ def write(self, vals): stage = self.env["res.partner.stage"].browse(stage_id) vals["state"] = stage.state res = super().write(vals) - if "stage_id" in vals: + if "stage_id" in vals and vals.get("stage_id") in self._state_from: self.restart_validation() return res From 01e7a7fc5e567370bb0defd281c626b7fe4fe3b6 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 30 Apr 2022 16:35:38 +0000 Subject: [PATCH 26/47] partner_tier_validation 14.0.3.0.2 --- partner_tier_validation/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index cdae869dc58..ae0338f3eb2 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Partner Tier Validation", "summary": "Support a tier validation process for Contacts", - "version": "14.0.3.0.1", + "version": "14.0.3.0.2", "website": "https://github.com/OCA/partner-contact", "category": "Contact", "author": "Open Source Integrators, Odoo Community Association (OCA)", From f951ebeee4921a4f6c90068d08f6fc2986babae1 Mon Sep 17 00:00:00 2001 From: David Montull Date: Wed, 14 Sep 2022 15:54:32 +0200 Subject: [PATCH 27/47] [IMP] partner_tier_validation: black, isort, prettier --- partner_tier_validation/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index ae0338f3eb2..76bb695ee3a 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Partner Tier Validation", "summary": "Support a tier validation process for Contacts", - "version": "14.0.3.0.2", + "version": "15.0.1.0.0", "website": "https://github.com/OCA/partner-contact", "category": "Contact", "author": "Open Source Integrators, Odoo Community Association (OCA)", From 3959ad6445af0c51ab55435331b4a0184025697a Mon Sep 17 00:00:00 2001 From: David Montull Date: Wed, 14 Sep 2022 16:39:13 +0200 Subject: [PATCH 28/47] [15.0][MIG] partner_tier_validation: Migration to 15.0 --- partner_tier_validation/test-requirements.txt | 1 + partner_tier_validation/tests/test_tier_validation.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 partner_tier_validation/test-requirements.txt diff --git a/partner_tier_validation/test-requirements.txt b/partner_tier_validation/test-requirements.txt new file mode 100644 index 00000000000..3044a912bf8 --- /dev/null +++ b/partner_tier_validation/test-requirements.txt @@ -0,0 +1 @@ +git+https://github.com/OCA/partner-contact/pull/1339/head#subdirectory=setup/partner_stage diff --git a/partner_tier_validation/tests/test_tier_validation.py b/partner_tier_validation/tests/test_tier_validation.py index 1a556b5763f..f9c348b8a95 100644 --- a/partner_tier_validation/tests/test_tier_validation.py +++ b/partner_tier_validation/tests/test_tier_validation.py @@ -6,7 +6,7 @@ @tagged("-at_install", "post_install") -class TestPartnerTierValidation(common.SavepointCase): +class TestPartnerTierValidation(common.TransactionCase): @classmethod def setUpClass(cls): super().setUpClass() @@ -70,6 +70,7 @@ def test_validation_res_partner(self): # Request and validate partner contact.request_validation() + contact.invalidate_cache() contact.with_user(self.user_approver).validate_tier() contact.with_user(self.user_approver).write( {"stage_id": self.stage_confirmed.id} From 83f1cd40831f2915f31c49784f19c9e7d2a34109 Mon Sep 17 00:00:00 2001 From: Urvisha-OSI Date: Mon, 20 Mar 2023 16:41:45 +0530 Subject: [PATCH 29/47] [IMP] partner_tier_validation: pre-commit stuff --- partner_tier_validation/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_tier_validation/__manifest__.py b/partner_tier_validation/__manifest__.py index 76bb695ee3a..d242d20626b 100644 --- a/partner_tier_validation/__manifest__.py +++ b/partner_tier_validation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Partner Tier Validation", "summary": "Support a tier validation process for Contacts", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "website": "https://github.com/OCA/partner-contact", "category": "Contact", "author": "Open Source Integrators, Odoo Community Association (OCA)", From 179fef6488842479541a0583284fdde2c6fe0c79 Mon Sep 17 00:00:00 2001 From: Urvisha-OSI Date: Mon, 20 Mar 2023 17:31:42 +0530 Subject: [PATCH 30/47] [MIG] partner_tier_validation: Migrated to 16.0 --- partner_tier_validation/README.rst | 15 ++++++++------- partner_tier_validation/readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 8 ++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/partner_tier_validation/README.rst b/partner_tier_validation/README.rst index b7b6df80689..3d4b19e9da1 100644 --- a/partner_tier_validation/README.rst +++ b/partner_tier_validation/README.rst @@ -14,14 +14,14 @@ Partner Tier Validation :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github - :target: https://github.com/OCA/partner-contact/tree/14.0/partner_tier_validation + :target: https://github.com/OCA/partner-contact/tree/16.0/partner_tier_validation :alt: OCA/partner-contact .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-partner_tier_validation + :target: https://translation.odoo-community.org/projects/partner-contact-16-0/partner-contact-16-0-partner_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/134/14.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/partner-contact&target_branch=16.0 + :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -83,7 +83,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -102,6 +102,7 @@ Contributors * Antonio Yamuta * Daniel Reis + * Urvisha Desai Maintainers ~~~~~~~~~~~ @@ -124,6 +125,6 @@ Current `maintainer `__: |maintainer-dreispt| -This module is part of the `OCA/partner-contact `_ project on GitHub. +This module is part of the `OCA/partner-contact `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/partner_tier_validation/readme/CONTRIBUTORS.rst b/partner_tier_validation/readme/CONTRIBUTORS.rst index 3c78380fe95..f3a6bc52754 100644 --- a/partner_tier_validation/readme/CONTRIBUTORS.rst +++ b/partner_tier_validation/readme/CONTRIBUTORS.rst @@ -2,3 +2,4 @@ * Antonio Yamuta * Daniel Reis + * Urvisha Desai diff --git a/partner_tier_validation/static/description/index.html b/partner_tier_validation/static/description/index.html index 156e0855771..969027956bf 100644 --- a/partner_tier_validation/static/description/index.html +++ b/partner_tier_validation/static/description/index.html @@ -3,7 +3,7 @@ - + Partner Tier Validation