diff --git a/crm_partner_required/README.rst b/crm_partner_required/README.rst new file mode 100644 index 00000000000..be99c61090e --- /dev/null +++ b/crm_partner_required/README.rst @@ -0,0 +1,117 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +==================== +CRM Partner Required +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:026387076fe7261b69b1f6d3911612a3df786394acb8210346145f5b786ef324 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcrm-lightgray.png?logo=github + :target: https://github.com/OCA/crm/tree/19.0/crm_partner_required + :alt: OCA/crm +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/crm-19-0/crm-19-0-crm_partner_required + :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=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of CRM and makes the field partner +required in the opportunity + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +This module was developed because the field "partner" might be important +for some companies and some salespersons don't fill it + +Usage +===== + +To use this module, you need to: + +1. Go to CRM. +2. Create new opportunity o choose one. +3. Update any field except the partner. +4. Try to save. +5. A error will be shown. +6. Fill partner. +7. Save. + +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 +------- + +* Moduon + +Contributors +------------ + +- Emilio Pascual (`Moduon `__) +- Joel Estrada (`Moduon `__) + +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. + +.. |maintainer-EmilioPascual| image:: https://github.com/EmilioPascual.png?size=40px + :target: https://github.com/EmilioPascual + :alt: EmilioPascual +.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px + :target: https://github.com/rafaelbn + :alt: rafaelbn + +Current `maintainers `__: + +|maintainer-EmilioPascual| |maintainer-rafaelbn| + +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_partner_required/__init__.py b/crm_partner_required/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/crm_partner_required/__manifest__.py b/crm_partner_required/__manifest__.py new file mode 100644 index 00000000000..9e6c5094ed3 --- /dev/null +++ b/crm_partner_required/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2025 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + +{ + "name": "CRM Partner Required", + "summary": "Field partner required in the opportunity", + "version": "19.0.1.0.0", + "development_status": "Alpha", + "category": "Sales/CRM", + "website": "https://github.com/OCA/crm", + "author": "Moduon, Odoo Community Association (OCA)", + "maintainers": ["EmilioPascual", "rafaelbn"], + "license": "LGPL-3", + "application": False, + "installable": True, + "depends": [ + "crm", + ], + "data": [ + "views/crm_lead_view.xml", + ], +} diff --git a/crm_partner_required/i18n/crm_partner_required.pot b/crm_partner_required/i18n/crm_partner_required.pot new file mode 100644 index 00000000000..aadee09bfed --- /dev/null +++ b/crm_partner_required/i18n/crm_partner_required.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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" diff --git a/crm_partner_required/i18n/it.po b/crm_partner_required/i18n/it.po new file mode 100644 index 00000000000..73388557f6d --- /dev/null +++ b/crm_partner_required/i18n/it.po @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" diff --git a/crm_partner_required/pyproject.toml b/crm_partner_required/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/crm_partner_required/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/crm_partner_required/readme/CONTEXT.md b/crm_partner_required/readme/CONTEXT.md new file mode 100644 index 00000000000..7bf8435158b --- /dev/null +++ b/crm_partner_required/readme/CONTEXT.md @@ -0,0 +1 @@ +This module was developed because the field "partner" might be important for some companies and some salespersons don't fill it diff --git a/crm_partner_required/readme/CONTRIBUTORS.md b/crm_partner_required/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..30da5d18476 --- /dev/null +++ b/crm_partner_required/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Emilio Pascual ([Moduon](https://www.moduon.team/)) +- Joel Estrada ([Moduon](https://www.moduon.team/)) \ No newline at end of file diff --git a/crm_partner_required/readme/DESCRIPTION.md b/crm_partner_required/readme/DESCRIPTION.md new file mode 100644 index 00000000000..090cf41d82e --- /dev/null +++ b/crm_partner_required/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module extends the functionality of CRM and makes the field partner required in the opportunity diff --git a/crm_partner_required/readme/USAGE.md b/crm_partner_required/readme/USAGE.md new file mode 100644 index 00000000000..c65bab40582 --- /dev/null +++ b/crm_partner_required/readme/USAGE.md @@ -0,0 +1,9 @@ +To use this module, you need to: + +1. Go to CRM. +1. Create new opportunity o choose one. +1. Update any field except the partner. +1. Try to save. +1. A error will be shown. +1. Fill partner. +1. Save. diff --git a/crm_partner_required/static/description/icon.png b/crm_partner_required/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/crm_partner_required/static/description/icon.png differ diff --git a/crm_partner_required/static/description/index.html b/crm_partner_required/static/description/index.html new file mode 100644 index 00000000000..1d1e3572d38 --- /dev/null +++ b/crm_partner_required/static/description/index.html @@ -0,0 +1,459 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

CRM Partner Required

+ +

Alpha License: LGPL-3 OCA/crm Translate me on Weblate Try me on Runboat

+

This module extends the functionality of CRM and makes the field partner +required in the opportunity

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Use Cases / Context

+

This module was developed because the field “partner” might be important +for some companies and some salespersons don’t fill it

+
+
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to CRM.
  2. +
  3. Create new opportunity o choose one.
  4. +
  5. Update any field except the partner.
  6. +
  7. Try to save.
  8. +
  9. A error will be shown.
  10. +
  11. Fill partner.
  12. +
  13. Save.
  14. +
+
+
+

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

+
    +
  • Moduon
  • +
+
+
+

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.

+

Current maintainers:

+

EmilioPascual rafaelbn

+

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_partner_required/tests/__init__.py b/crm_partner_required/tests/__init__.py new file mode 100644 index 00000000000..a675ded9b0d --- /dev/null +++ b/crm_partner_required/tests/__init__.py @@ -0,0 +1 @@ +from . import test_crm_partner_required diff --git a/crm_partner_required/tests/test_crm_partner_required.py b/crm_partner_required/tests/test_crm_partner_required.py new file mode 100644 index 00000000000..f195a2e57ad --- /dev/null +++ b/crm_partner_required/tests/test_crm_partner_required.py @@ -0,0 +1,38 @@ +# Copyright 2025 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + +from odoo.tests import Form +from odoo.tests.common import TransactionCase + + +class TestCRMPartnerRequired(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.partner = cls.env["res.partner"].create({"name": "Test Partner"}) + + def test_crm_partner_required(self): + """Check partner_id required in opportunity""" + # Check required in opportunity in default form + opportunity_form = Form( + self.env["crm.lead"].with_context(default_type="opportunity") + ) + opportunity_form.name = "Test Opportunity" + with self.assertRaises(AssertionError): + opportunity_form.save() + opportunity_form.partner_id = self.partner + opportunity_form.save() + # Check required in opportunity in quick create form + opportunity_quick_create_form = Form( + self.env["crm.lead"].with_context(default_type="opportunity"), + "crm.quick_create_opportunity_form", + ) + opportunity_quick_create_form.name = "Test Opportunity Quick Create" + with self.assertRaises(AssertionError): + opportunity_quick_create_form.save() + opportunity_quick_create_form.partner_id = self.partner + opportunity_quick_create_form.save() + # Check required in lead in default form + lead_form = Form(self.env["crm.lead"].with_context(default_type="lead")) + lead_form.name = "Test Lead" + lead_form.save() diff --git a/crm_partner_required/views/crm_lead_view.xml b/crm_partner_required/views/crm_lead_view.xml new file mode 100644 index 00000000000..0123a49855f --- /dev/null +++ b/crm_partner_required/views/crm_lead_view.xml @@ -0,0 +1,34 @@ + + + + + Partner required form + crm.lead + + + + type == 'opportunity' + + + type == 'opportunity' + + + + + Partner required quick create form + crm.lead + + + + type == 'opportunity' + + + +