From 6f4e0b8aa3aa95adbbf511ffe35b418eb18d23a6 Mon Sep 17 00:00:00 2001 From: Vehiana Tepuhiarii Date: Tue, 14 Jan 2025 15:05:16 -1000 Subject: [PATCH] [ADD] Add crm_lead_approval module --- crm_lead_approval/README.rst | 115 +++++ crm_lead_approval/__init__.py | 5 + crm_lead_approval/__manifest__.py | 20 + crm_lead_approval/i18n/crm_lead_approval.pot | 175 +++++++ crm_lead_approval/i18n/fr.po | 180 +++++++ crm_lead_approval/models/__init__.py | 6 + crm_lead_approval/models/crm_lead.py | 31 ++ crm_lead_approval/models/res_company.py | 11 + .../models/res_config_settings.py | 23 + crm_lead_approval/pyproject.toml | 3 + crm_lead_approval/readme/CONFIGURE.md | 6 + crm_lead_approval/readme/CONTRIBUTORS.md | 2 + crm_lead_approval/readme/DESCRIPTION.md | 3 + crm_lead_approval/readme/USAGE.md | 13 + .../security/ir.model.access.csv | 2 + .../static/description/index.html | 470 ++++++++++++++++++ crm_lead_approval/views/crm_lead_views.xml | 66 +++ .../views/res_config_settings.xml | 28 ++ crm_lead_approval/wizard/__init__.py | 4 + crm_lead_approval/wizard/approval_wizard.py | 34 ++ .../wizard/approval_wizard_views.xml | 48 ++ 21 files changed, 1245 insertions(+) create mode 100644 crm_lead_approval/README.rst create mode 100644 crm_lead_approval/__init__.py create mode 100644 crm_lead_approval/__manifest__.py create mode 100644 crm_lead_approval/i18n/crm_lead_approval.pot create mode 100644 crm_lead_approval/i18n/fr.po create mode 100644 crm_lead_approval/models/__init__.py create mode 100644 crm_lead_approval/models/crm_lead.py create mode 100644 crm_lead_approval/models/res_company.py create mode 100644 crm_lead_approval/models/res_config_settings.py create mode 100644 crm_lead_approval/pyproject.toml create mode 100644 crm_lead_approval/readme/CONFIGURE.md create mode 100644 crm_lead_approval/readme/CONTRIBUTORS.md create mode 100644 crm_lead_approval/readme/DESCRIPTION.md create mode 100644 crm_lead_approval/readme/USAGE.md create mode 100644 crm_lead_approval/security/ir.model.access.csv create mode 100644 crm_lead_approval/static/description/index.html create mode 100644 crm_lead_approval/views/crm_lead_views.xml create mode 100644 crm_lead_approval/views/res_config_settings.xml create mode 100644 crm_lead_approval/wizard/__init__.py create mode 100644 crm_lead_approval/wizard/approval_wizard.py create mode 100644 crm_lead_approval/wizard/approval_wizard_views.xml diff --git a/crm_lead_approval/README.rst b/crm_lead_approval/README.rst new file mode 100644 index 00000000000..81bc5618502 --- /dev/null +++ b/crm_lead_approval/README.rst @@ -0,0 +1,115 @@ +================= +CRM Lead Approval +================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:735245e54463fae2254dcd6790ba909be3fd49ff8ffcb6119b2dbad96172d7fc + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fcrm-lightgray.png?logo=github + :target: https://github.com/OCA/crm/tree/17.0/crm_lead_approval + :alt: OCA/crm +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/crm-17-0/crm-17-0-crm_lead_approval + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/crm&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module enables an approval process for opportunities in the CRM. +Approvals can be configured according to Sales Teams or CRM Tags and +then matching opportunities can be submitted to the approval process +through a dedicated button. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +1. Navigate to the CRM settings. +2. Add the relevant Sales Teams and/or CRM Tags to the "Sales Teams + opportunities approval" and "CRM Tags opportunities approval" + settings. + +Once configured, the approval button will appear in leads, allowing them +to enter the approval process, but only for opportunities associated +with the specified Sales Teams or CRM Tags. + +Usage +===== + +1. Access your leads in the CRM: + +- Go to *CRM > Sales > My Pipeline*. +- Open an existing lead or create a new one. + +2. Provide an opinion on the lead: + +- Locate the approval button "Approve/Refuse" on the left side of the + screen (visible only if you have the necessary permissions). +- Click the button, and an approval popup will appear. +- Optionally, add a comment to justify your opinion. +- Click one of the following buttons to confirm and submit your opinion: + "Approve", "Reserved", or "Disapprove". + +3. Message added to the lead's chatter: + +- Once the opinion is submitted, a message will automatically be added + to the lead's chatter, recording the opinion and any accompanying + comment. + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* INVITU SARL + +Contributors +------------ + +- Cyril VINH-TUNG +- Vehiana TEPUHIARII + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/crm `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/crm_lead_approval/__init__.py b/crm_lead_approval/__init__.py new file mode 100644 index 00000000000..90fc4e7edec --- /dev/null +++ b/crm_lead_approval/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2024 INVITU SARL +# License AGPL-3 or later (https://www.gnu.org/licenses/agpl.html). + +from . import models +from . import wizard diff --git a/crm_lead_approval/__manifest__.py b/crm_lead_approval/__manifest__.py new file mode 100644 index 00000000000..203fffff1c9 --- /dev/null +++ b/crm_lead_approval/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2024 INVITU SARL +# License AGPL-3 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "CRM Lead Approval", + "summary": "This module allows to approve or not a lead.", + "version": "17.0.1.0.0", + "category": "Customer Relationship Management", + "author": "INVITU SARL, Odoo Community Association (OCA)", + "license": "AGPL-3", + "website": "https://github.com/OCA/crm", + "depends": [ + "crm", + ], + "data": [ + "security/ir.model.access.csv", + "views/res_config_settings.xml", + "wizard/approval_wizard_views.xml", + "views/crm_lead_views.xml", + ], +} diff --git a/crm_lead_approval/i18n/crm_lead_approval.pot b/crm_lead_approval/i18n/crm_lead_approval.pot new file mode 100644 index 00000000000..e3cdc03dfe3 --- /dev/null +++ b/crm_lead_approval/i18n/crm_lead_approval.pot @@ -0,0 +1,175 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_approval +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-01-16 21:00+0000\n" +"PO-Revision-Date: 2025-01-16 21:00+0000\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: crm_lead_approval +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.res_config_settings_approved_teams +msgid "" +"Allow opportunities to proceed through the approval process with these CRM " +"Tags." +msgstr "" + +#. module: crm_lead_approval +#: model:ir.actions.act_window,name:crm_lead_approval.action_crm_approval_wizard +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_lead__approval +msgid "Approval" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_res_company__approval_tag_ids +msgid "Approval Tag" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_res_company__approval_team_ids +msgid "Approval Team" +msgstr "" + +#. module: crm_lead_approval +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_approval_wizard_form +msgid "Approval wizard" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields.selection,name:crm_lead_approval.selection__crm_lead__approval__done +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_approval_wizard_form +msgid "Approve" +msgstr "" + +#. module: crm_lead_approval +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_lead_form_approval +msgid "Approve/Refuse" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model,name:crm_lead_approval.model_crm_approval_wizard +msgid "CRM Approval Wizard" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_res_config_settings__approval_tag_ids +msgid "CRM Tags opportunities approval" +msgstr "" + +#. module: crm_lead_approval +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_approval_wizard_form +msgid "Cancel" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,help:crm_lead_approval.field_res_config_settings__approval_tag_ids +msgid "Choose CRM tags for which you want opportunity approval" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,help:crm_lead_approval.field_res_config_settings__approval_team_ids +msgid "Choose Sales Teams for which you want opportunity approval" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model,name:crm_lead_approval.model_res_company +msgid "Companies" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model,name:crm_lead_approval.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__create_uid +msgid "Created by" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__create_date +msgid "Created on" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields.selection,name:crm_lead_approval.selection__crm_lead__approval__blocked +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_approval_wizard_form +msgid "Disapprove" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_lead_approval +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.res_config_settings_approved_teams +msgid "" +"Enable these Sales Teams to provide their approval in the opportunities " +"assigned to them." +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__id +msgid "ID" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,help:crm_lead_approval.field_crm_lead__to_be_approved +msgid "" +"Indicates whether the record required approval or not" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__write_date +msgid "Last Updated on" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model,name:crm_lead_approval.model_crm_lead +msgid "Lead/Opportunity" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields.selection,name:crm_lead_approval.selection__crm_lead__approval__none +msgid "None" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__approval_comment +msgid "Observation" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__lead_id +msgid "Opportunity" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields.selection,name:crm_lead_approval.selection__crm_lead__approval__normal +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_approval_wizard_form +msgid "Reserved" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_res_config_settings__approval_team_ids +msgid "Sales Teams opportunities approval" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_lead__to_be_approved +msgid "To be approved" +msgstr "" diff --git a/crm_lead_approval/i18n/fr.po b/crm_lead_approval/i18n/fr.po new file mode 100644 index 00000000000..e687a5e5e72 --- /dev/null +++ b/crm_lead_approval/i18n/fr.po @@ -0,0 +1,180 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * crm_lead_approval +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-01-16 21:00+0000\n" +"PO-Revision-Date: 2025-01-16 21:00+0000\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: crm_lead_approval +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.res_config_settings_approved_teams +msgid "" +"Allow opportunities to proceed through the approval process with these CRM " +"Tags." +msgstr "" +"Permettre aux opportunités de passer dans le processus d'approbation " +"grâce à ces étiquettes." + +#. module: crm_lead_approval +#: model:ir.actions.act_window,name:crm_lead_approval.action_crm_approval_wizard +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_lead__approval +msgid "Approval" +msgstr "Avis" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_res_company__approval_tag_ids +msgid "Approval Tag" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_res_company__approval_team_ids +msgid "Approval Team" +msgstr "" + +#. module: crm_lead_approval +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_approval_wizard_form +msgid "Approval wizard" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields.selection,name:crm_lead_approval.selection__crm_lead__approval__done +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_approval_wizard_form +msgid "Approve" +msgstr "Favorable" + +#. module: crm_lead_approval +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_lead_form_approval +msgid "Approve/Refuse" +msgstr "Approuver/Refuser" + +#. module: crm_lead_approval +#: model:ir.model,name:crm_lead_approval.model_crm_approval_wizard +msgid "CRM Approval Wizard" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_res_config_settings__approval_tag_ids +msgid "CRM Tags opportunities approval" +msgstr "" + +#. module: crm_lead_approval +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_approval_wizard_form +msgid "Cancel" +msgstr "Annuler" + +#. module: crm_lead_approval +#: model:ir.model.fields,help:crm_lead_approval.field_res_config_settings__approval_tag_ids +msgid "Choose CRM tags for which you want opportunity approval" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,help:crm_lead_approval.field_res_config_settings__approval_team_ids +msgid "Choose Sales Teams for which you want opportunity approval" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model,name:crm_lead_approval.model_res_company +msgid "Companies" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model,name:crm_lead_approval.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__create_uid +msgid "Created by" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__create_date +msgid "Created on" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields.selection,name:crm_lead_approval.selection__crm_lead__approval__blocked +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_approval_wizard_form +msgid "Disapprove" +msgstr "Défavorable" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__display_name +msgid "Display Name" +msgstr "" + +#. module: crm_lead_approval +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.res_config_settings_approved_teams +msgid "" +"Enable these Sales Teams to provide their approval in the opportunities " +"assigned to them." +msgstr "" +"Permettre à ces équipes commerciales de donner leur approbation dans " +"les opportunités qui leur sont assignées." + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__id +msgid "ID" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,help:crm_lead_approval.field_crm_lead__to_be_approved +msgid "" +"Indicates whether the record required approval or not" +msgstr "" +"Indique si l'enregistrement nécessite une approbation ou pas" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__write_date +msgid "Last Updated on" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model,name:crm_lead_approval.model_crm_lead +msgid "Lead/Opportunity" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields.selection,name:crm_lead_approval.selection__crm_lead__approval__none +msgid "None" +msgstr "Aucun" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__approval_comment +msgid "Observation" +msgstr "Observation" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_approval_wizard__lead_id +msgid "Opportunity" +msgstr "Opportunité" + +#. module: crm_lead_approval +#: model:ir.model.fields.selection,name:crm_lead_approval.selection__crm_lead__approval__normal +#: model_terms:ir.ui.view,arch_db:crm_lead_approval.view_crm_approval_wizard_form +msgid "Reserved" +msgstr "Réservé" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_res_config_settings__approval_team_ids +msgid "Sales Teams opportunities approval" +msgstr "" + +#. module: crm_lead_approval +#: model:ir.model.fields,field_description:crm_lead_approval.field_crm_lead__to_be_approved +msgid "To be approved" +msgstr "À approuver" diff --git a/crm_lead_approval/models/__init__.py b/crm_lead_approval/models/__init__.py new file mode 100644 index 00000000000..4722fdd3fa4 --- /dev/null +++ b/crm_lead_approval/models/__init__.py @@ -0,0 +1,6 @@ +# Copyright 2024 INVITU SARL +# License AGPL-3 or later (https://www.gnu.org/licenses/agpl.html). + +from . import res_company +from . import res_config_settings +from . import crm_lead diff --git a/crm_lead_approval/models/crm_lead.py b/crm_lead_approval/models/crm_lead.py new file mode 100644 index 00000000000..c8fc95513b1 --- /dev/null +++ b/crm_lead_approval/models/crm_lead.py @@ -0,0 +1,31 @@ +# Copyright 2024 INVITU SARL +# License AGPL-3 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class CrmLead(models.Model): + _inherit = "crm.lead" + + approval = fields.Selection( + [ + ("none", "None"), + ("done", "Approve"), + ("normal", "Reserved"), + ("blocked", "Disapprove"), + ], + default="none", + tracking=True, + ) + to_be_approved = fields.Boolean( + string="To be approved", + compute="_compute_approve", + help="Indicates whether the record required approval or not", + ) + + def _compute_approve(self): + for record in self: + record.to_be_approved = ( + record.team_id in self.env.company.approval_team_ids + or record.tag_ids in self.env.company.approval_tag_ids + ) diff --git a/crm_lead_approval/models/res_company.py b/crm_lead_approval/models/res_company.py new file mode 100644 index 00000000000..009fd46ba35 --- /dev/null +++ b/crm_lead_approval/models/res_company.py @@ -0,0 +1,11 @@ +# Copyright 2024 INVITU SARL +# License AGPL-3 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ResCompany(models.Model): + _inherit = "res.company" + + approval_team_ids = fields.Many2many("crm.team") + approval_tag_ids = fields.Many2many("crm.tag") diff --git a/crm_lead_approval/models/res_config_settings.py b/crm_lead_approval/models/res_config_settings.py new file mode 100644 index 00000000000..dc5ce09bc2d --- /dev/null +++ b/crm_lead_approval/models/res_config_settings.py @@ -0,0 +1,23 @@ +# Copyright 2024 INVITU SARL +# License AGPL-3 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + approval_team_ids = fields.Many2many( + "crm.team", + string="Sales Teams opportunities approval", + readonly=False, + related="company_id.approval_team_ids", + help="Choose Sales Teams for which you want opportunity approval", + ) + approval_tag_ids = fields.Many2many( + "crm.tag", + string="CRM Tags opportunities approval", + readonly=False, + related="company_id.approval_tag_ids", + help="Choose CRM tags for which you want opportunity approval", + ) diff --git a/crm_lead_approval/pyproject.toml b/crm_lead_approval/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/crm_lead_approval/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/crm_lead_approval/readme/CONFIGURE.md b/crm_lead_approval/readme/CONFIGURE.md new file mode 100644 index 00000000000..6cf91baf768 --- /dev/null +++ b/crm_lead_approval/readme/CONFIGURE.md @@ -0,0 +1,6 @@ +1. Navigate to the CRM settings. +2. Add the relevant Sales Teams and/or CRM Tags to the "Sales Teams opportunities approval" and +"CRM Tags opportunities approval" settings. + +Once configured, the approval button will appear in leads, allowing them to enter the approval process, but +only for opportunities associated with the specified Sales Teams or CRM Tags. diff --git a/crm_lead_approval/readme/CONTRIBUTORS.md b/crm_lead_approval/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..1620942e6a7 --- /dev/null +++ b/crm_lead_approval/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Cyril VINH-TUNG \<\> +- Vehiana TEPUHIARII \<\> diff --git a/crm_lead_approval/readme/DESCRIPTION.md b/crm_lead_approval/readme/DESCRIPTION.md new file mode 100644 index 00000000000..ab89c9805eb --- /dev/null +++ b/crm_lead_approval/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module enables an approval process for opportunities in the CRM. +Approvals can be configured according to Sales Teams or CRM Tags +and then matching opportunities can be submitted to the approval process through a dedicated button. diff --git a/crm_lead_approval/readme/USAGE.md b/crm_lead_approval/readme/USAGE.md new file mode 100644 index 00000000000..609a14ac1ef --- /dev/null +++ b/crm_lead_approval/readme/USAGE.md @@ -0,0 +1,13 @@ +1. Access your leads in the CRM: +- Go to *CRM > Sales > My Pipeline*. +- Open an existing lead or create a new one. + +2. Provide an opinion on the lead: +- Locate the approval button "Approve/Refuse" on the left side of the screen (visible only if you have the necessary permissions). +- Click the button, and an approval popup will appear. +- Optionally, add a comment to justify your opinion. +- Click one of the following buttons to confirm and submit your opinion: "Approve", "Reserved", or "Disapprove". + +3. Message added to the lead's chatter: +- Once the opinion is submitted, a message will automatically be added to the lead's chatter, recording +the opinion and any accompanying comment. diff --git a/crm_lead_approval/security/ir.model.access.csv b/crm_lead_approval/security/ir.model.access.csv new file mode 100644 index 00000000000..bd1b6e5b0e5 --- /dev/null +++ b/crm_lead_approval/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_crm_approval_wizard,access_crm_approval_wizard,model_crm_approval_wizard,base.group_user,1,1,1,1 diff --git a/crm_lead_approval/static/description/index.html b/crm_lead_approval/static/description/index.html new file mode 100644 index 00000000000..a28929ee5c4 --- /dev/null +++ b/crm_lead_approval/static/description/index.html @@ -0,0 +1,470 @@ + + + + + +CRM Lead Approval + + + +
+

CRM Lead Approval

+ + +

Beta License: AGPL-3 OCA/crm Translate me on Weblate Try me on Runboat

+

This module enables an approval process for opportunities in the CRM. +Approvals can be configured according to Sales Teams or CRM Tags and +then matching opportunities can be submitted to the approval process +through a dedicated button.

+

Table of contents

+ +
+

Configuration

+
    +
  1. Navigate to the CRM settings.
  2. +
  3. Add the relevant Sales Teams and/or CRM Tags to the “Sales Teams +opportunities approval” and “CRM Tags opportunities approval” +settings.
  4. +
+

Once configured, the approval button will appear in leads, allowing them +to enter the approval process, but only for opportunities associated +with the specified Sales Teams or CRM Tags.

+
+
+

Usage

+
    +
  1. Access your leads in the CRM:
  2. +
+
    +
  • Go to CRM > Sales > My Pipeline.
  • +
  • Open an existing lead or create a new one.
  • +
+
    +
  1. Provide an opinion on the lead:
  2. +
+
    +
  • Locate the approval button “Approve/Refuse” on the left side of the +screen (visible only if you have the necessary permissions).
  • +
  • Click the button, and an approval popup will appear.
  • +
  • Optionally, add a comment to justify your opinion.
  • +
  • Click one of the following buttons to confirm and submit your opinion: +“Approve”, “Reserved”, or “Disapprove”.
  • +
+
    +
  1. Message added to the lead’s chatter:
  2. +
+
    +
  • Once the opinion is submitted, a message will automatically be added +to the lead’s chatter, recording the opinion and any accompanying +comment.
  • +
+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • INVITU SARL
  • +
+
+
+

Contributors

+ +
+
+

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

+

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

+
+
+
+ + diff --git a/crm_lead_approval/views/crm_lead_views.xml b/crm_lead_approval/views/crm_lead_views.xml new file mode 100644 index 00000000000..90e72b79d1c --- /dev/null +++ b/crm_lead_approval/views/crm_lead_views.xml @@ -0,0 +1,66 @@ + + + view.crm.lead.form.approval + crm.lead + + + + +