diff --git a/partner_category_security_crm/README.rst b/partner_category_security_crm/README.rst new file mode 100644 index 000000000..88c24fca2 --- /dev/null +++ b/partner_category_security_crm/README.rst @@ -0,0 +1,89 @@ +========================================= +Partner category security (crm extension) +========================================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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_category_security_crm + :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_category_security_crm + :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 + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This is a glue module between "partner_category_security" and "crm" to mitigate the permissions to manage contact tags. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +#. *Sales / User: Own Documents Only* permission only allows reading the tags assigned to contacts. + +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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * Víctor Martínez + * Pedro M. Baeza + +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-victoralmau| image:: https://github.com/victoralmau.png?size=40px + :target: https://github.com/victoralmau + :alt: victoralmau + +Current `maintainer `__: + +|maintainer-victoralmau| + +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_category_security_crm/__init__.py b/partner_category_security_crm/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/partner_category_security_crm/__manifest__.py b/partner_category_security_crm/__manifest__.py new file mode 100644 index 000000000..98064058b --- /dev/null +++ b/partner_category_security_crm/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2022 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Partner category security (crm extension)", + "version": "14.0.1.0.0", + "category": "Customer Relationship Management", + "website": "https://github.com/OCA/partner-contact", + "author": "Tecnativa, Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": ["partner_category_security", "crm"], + "installable": True, + "auto_install": True, + "data": [ + "security/ir.model.access.csv", + ], + "maintainers": ["victoralmau"], +} diff --git a/partner_category_security_crm/i18n/es.po b/partner_category_security_crm/i18n/es.po new file mode 100644 index 000000000..9f17dea27 --- /dev/null +++ b/partner_category_security_crm/i18n/es.po @@ -0,0 +1,15 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-26 10:00+0000\n" +"PO-Revision-Date: 2022-08-26 10: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" diff --git a/partner_category_security_crm/i18n/partner_category_security_crm.pot b/partner_category_security_crm/i18n/partner_category_security_crm.pot new file mode 100644 index 000000000..93242b4b4 --- /dev/null +++ b/partner_category_security_crm/i18n/partner_category_security_crm.pot @@ -0,0 +1,15 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-26 09:59+0000\n" +"PO-Revision-Date: 2022-08-26 09:59+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" diff --git a/partner_category_security_crm/readme/CONTRIBUTORS.rst b/partner_category_security_crm/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..5fb713053 --- /dev/null +++ b/partner_category_security_crm/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Tecnativa `_: + + * Víctor Martínez + * Pedro M. Baeza diff --git a/partner_category_security_crm/readme/DESCRIPTION.rst b/partner_category_security_crm/readme/DESCRIPTION.rst new file mode 100644 index 000000000..62fd4fe71 --- /dev/null +++ b/partner_category_security_crm/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This is a glue module between "partner_category_security" and "crm" to mitigate the permissions to manage contact tags. diff --git a/partner_category_security_crm/readme/USAGE.rst b/partner_category_security_crm/readme/USAGE.rst new file mode 100644 index 000000000..6a9f84aee --- /dev/null +++ b/partner_category_security_crm/readme/USAGE.rst @@ -0,0 +1 @@ +#. *Sales / User: Own Documents Only* permission only allows reading the tags assigned to contacts. diff --git a/partner_category_security_crm/security/ir.model.access.csv b/partner_category_security_crm/security/ir.model.access.csv new file mode 100644 index 000000000..0f66bc06f --- /dev/null +++ b/partner_category_security_crm/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 +crm.access_res_partner_category,res.partner.category.crm.user,base.model_res_partner_category,sales_team.group_sale_salesman,1,0,0,0 diff --git a/partner_category_security_crm/static/description/icon.png b/partner_category_security_crm/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/partner_category_security_crm/static/description/icon.png differ diff --git a/partner_category_security_crm/static/description/index.html b/partner_category_security_crm/static/description/index.html new file mode 100644 index 000000000..6f6c10d2d --- /dev/null +++ b/partner_category_security_crm/static/description/index.html @@ -0,0 +1,432 @@ + + + + + + +Partner category security (crm extension) + + + +
+

Partner category security (crm extension)

+ + +

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

+

This is a glue module between “partner_category_security” and “crm” to mitigate the permissions to manage contact tags.

+

Table of contents

+ +
+

Usage

+
    +
  1. Sales / User: Own Documents Only permission only allows reading the tags assigned to contacts.
  2. +
+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Tecnativa:
      +
    • Víctor Martínez
    • +
    • Pedro M. Baeza
    • +
    +
  • +
+
+
+

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:

+

victoralmau

+

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_category_security_crm/tests/__init__.py b/partner_category_security_crm/tests/__init__.py new file mode 100644 index 000000000..078718e8c --- /dev/null +++ b/partner_category_security_crm/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_partner_category_security_crm diff --git a/partner_category_security_crm/tests/test_partner_category_security_crm.py b/partner_category_security_crm/tests/test_partner_category_security_crm.py new file mode 100644 index 000000000..9d3b4787d --- /dev/null +++ b/partner_category_security_crm/tests/test_partner_category_security_crm.py @@ -0,0 +1,26 @@ +# Copyright 2022 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests import new_test_user + +from odoo.addons.partner_category_security.tests.test_partner_category_security import ( + TestPartnerCategorySecurity, +) + + +class TestPartnerCategorySecurityCrm(TestPartnerCategorySecurity): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.salesman_user = new_test_user( + cls.env, + login="Test salesmane", + groups="sales_team.group_sale_salesman", + ) + + def test_check_access_rights_salesman_user(self): + model = self.partner_category_model.with_user(self.salesman_user) + self.assertTrue(model.check_access_rights("read", False)) + self.assertFalse(model.check_access_rights("write", False)) + self.assertFalse(model.check_access_rights("create", False)) + self.assertFalse(model.check_access_rights("unlink", False)) diff --git a/setup/partner_category_security_crm/odoo/addons/partner_category_security_crm b/setup/partner_category_security_crm/odoo/addons/partner_category_security_crm new file mode 120000 index 000000000..a6b417747 --- /dev/null +++ b/setup/partner_category_security_crm/odoo/addons/partner_category_security_crm @@ -0,0 +1 @@ +../../../../partner_category_security_crm \ No newline at end of file diff --git a/setup/partner_category_security_crm/setup.py b/setup/partner_category_security_crm/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/partner_category_security_crm/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)