diff --git a/sales_team_security_crm/README.rst b/sales_team_security_crm/README.rst new file mode 100644 index 00000000000..acada078b26 --- /dev/null +++ b/sales_team_security_crm/README.rst @@ -0,0 +1,101 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +================================== +CRM documents permissions by teams +================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1c8be08954ebcdc5c15a90412fe1b9a70cbd78109585b6488d5fe439aebaa09f + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |badge2| image:: https://img.shields.io/badge/license-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%2Fsale--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/sale-workflow/tree/19.0/sales_team_security_crm + :alt: OCA/sale-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/sale-workflow-19-0/sale-workflow-19-0-sales_team_security_crm + :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/sale-workflow&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Glue module between sales_team_security and crm. + +**Table of contents** + +.. contents:: + :local: + +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 +------- + +* Tecnativa +* Iván Todorovich + +Contributors +------------ + +- `Tecnativa `__: + + - Pedro M. Baeza + - César A. Sánchez + +- `Guadaltech `__: + + - Ramón Bajona + +- Iván Todorovich +- `Pesol `__: + + - Jonathan Oscategui Taza + +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-ivantodorovich| image:: https://github.com/ivantodorovich.png?size=40px + :target: https://github.com/ivantodorovich + :alt: ivantodorovich + +Current `maintainer `__: + +|maintainer-ivantodorovich| + +This module is part of the `OCA/sale-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sales_team_security_crm/__init__.py b/sales_team_security_crm/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/sales_team_security_crm/__manifest__.py b/sales_team_security_crm/__manifest__.py new file mode 100644 index 00000000000..007ee68a176 --- /dev/null +++ b/sales_team_security_crm/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2020 Iván Todorovich +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "CRM documents permissions by teams", + "summary": "Integrates sales_team_security with crm", + "version": "19.0.1.0.0", + "category": "Customer Relationship Management", + "website": "https://github.com/OCA/sale-workflow", + "author": "Tecnativa, Iván Todorovich, Odoo Community Association (OCA)", + "license": "AGPL-3", + "development_status": "Production/Stable", + "maintainers": ["ivantodorovich"], + "depends": ["crm", "sales_team_security"], + "data": ["security/security.xml"], + "auto_install": True, +} diff --git a/sales_team_security_crm/i18n/sales_team_security_crm.pot b/sales_team_security_crm/i18n/sales_team_security_crm.pot new file mode 100644 index 00000000000..a11baf5cd77 --- /dev/null +++ b/sales_team_security_crm/i18n/sales_team_security_crm.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 15.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/sales_team_security_crm/pyproject.toml b/sales_team_security_crm/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/sales_team_security_crm/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/sales_team_security_crm/readme/CONTRIBUTORS.md b/sales_team_security_crm/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..09569526189 --- /dev/null +++ b/sales_team_security_crm/readme/CONTRIBUTORS.md @@ -0,0 +1,8 @@ +- [Tecnativa](https://www.tecnativa.com): + - Pedro M. Baeza + - César A. Sánchez +- [Guadaltech](https://www.guadaltech.es): + - Ramón Bajona +- Iván Todorovich \<\> +- [Pesol](https://www.pesol.es): + - Jonathan Oscategui Taza \<\> diff --git a/sales_team_security_crm/readme/DESCRIPTION.md b/sales_team_security_crm/readme/DESCRIPTION.md new file mode 100644 index 00000000000..cb0f515c619 --- /dev/null +++ b/sales_team_security_crm/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Glue module between sales_team_security and crm. diff --git a/sales_team_security_crm/security/security.xml b/sales_team_security_crm/security/security.xml new file mode 100644 index 00000000000..a69f64c2309 --- /dev/null +++ b/sales_team_security_crm/security/security.xml @@ -0,0 +1,36 @@ + + + + Team Leads/Opportunities + + ['|', ('user_id', 'in', [user.id, False]), ('team_id', 'in', user.crm_team_ids.ids + [False])] + + + + + Team Activities Analysis + + ['|', ('user_id', 'in', [user.id, False]), ('team_id', 'in', user.crm_team_ids.ids + [False])] + + + + + Own Sale Teams + + [('id', 'in', user.crm_team_ids.ids)] + + + diff --git a/sales_team_security_crm/static/description/icon.png b/sales_team_security_crm/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/sales_team_security_crm/static/description/icon.png differ diff --git a/sales_team_security_crm/static/description/index.html b/sales_team_security_crm/static/description/index.html new file mode 100644 index 00000000000..6f56407b143 --- /dev/null +++ b/sales_team_security_crm/static/description/index.html @@ -0,0 +1,445 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

CRM documents permissions by teams

+ +

Production/Stable License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

+

Glue module between sales_team_security and crm.

+

Table of contents

+ +
+

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

+
    +
  • Tecnativa
  • +
  • Iván Todorovich
  • +
+
+
+

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 maintainer:

+

ivantodorovich

+

This module is part of the OCA/sale-workflow project on GitHub.

+

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

+
+
+
+
+ + diff --git a/sales_team_security_crm/tests/__init__.py b/sales_team_security_crm/tests/__init__.py new file mode 100644 index 00000000000..07fdd941c1e --- /dev/null +++ b/sales_team_security_crm/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_sales_team_security_crm diff --git a/sales_team_security_crm/tests/test_sales_team_security_crm.py b/sales_team_security_crm/tests/test_sales_team_security_crm.py new file mode 100644 index 00000000000..904e415b294 --- /dev/null +++ b/sales_team_security_crm/tests/test_sales_team_security_crm.py @@ -0,0 +1,21 @@ +# Copyright 2021 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.sales_team_security.tests.common import TestCommon + + +class TestSalesTeamSecurityCrm(TestCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.record = cls.env["crm.lead"].create( + { + "name": "Test lead", + "partner_id": cls.partner.id, + "user_id": cls.user.id, + "team_id": cls.team.id, + } + ) + + def test_crm_lead_permissions(self): + self._check_whole_permission_set(extra_checks=False)