diff --git a/README.md b/README.md index 09c18f8794d..6c96e7ea5d7 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ addon | version | maintainers | summary [partner_bank_code](partner_bank_code/) | 16.0.1.0.1 | | Add fields information in banks [partner_capital](partner_capital/) | 16.0.0.1.1 | [![EmilioPascual](https://github.com/EmilioPascual.png?size=30px)](https://github.com/EmilioPascual) | Partners Capital [partner_category_security](partner_category_security/) | 16.0.1.0.0 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Partner category security +[partner_category_security_crm](partner_category_security_crm/) | 16.0.1.0.0 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Partner category security (crm extension) [partner_category_type](partner_category_type/) | 16.0.1.0.0 | [![JordiMForgeFlow](https://github.com/JordiMForgeFlow.png?size=30px)](https://github.com/JordiMForgeFlow) | Add a selection field 'Type' to classify Contact Tags. [partner_company_default](partner_company_default/) | 16.0.1.1.1 | | Partner Company Default [partner_company_group](partner_company_group/) | 16.0.1.0.0 | [![luisg123v](https://github.com/luisg123v.png?size=30px)](https://github.com/luisg123v) | Adds the possibility to add a company group to a company diff --git a/partner_category_security_crm/README.rst b/partner_category_security_crm/README.rst new file mode 100644 index 00000000000..9f73e0cd88f --- /dev/null +++ b/partner_category_security_crm/README.rst @@ -0,0 +1,92 @@ +========================================= +Partner category security (crm extension) +========================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:7f0046e754745dc7366d659681b589dfdb93ff6e8e1dc37a0724a96dbe8dd3aa + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.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-16-0/partner-contact-16-0-partner_category_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/partner-contact&target_branch=16.0 + :alt: Try me on Runboat + +|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 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 + +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 00000000000..e69de29bb2d diff --git a/partner_category_security_crm/__manifest__.py b/partner_category_security_crm/__manifest__.py new file mode 100644 index 00000000000..0b3349af2e7 --- /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": "16.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 00000000000..e69de29bb2d diff --git a/partner_category_security_crm/i18n/it.po b/partner_category_security_crm/i18n/it.po new file mode 100644 index 00000000000..e69de29bb2d 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 00000000000..78d58d53fe0 --- /dev/null +++ b/partner_category_security_crm/i18n/partner_category_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 16.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/partner_category_security_crm/readme/CONTRIBUTORS.rst b/partner_category_security_crm/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..5fb71305308 --- /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 00000000000..62fd4fe71e6 --- /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 00000000000..6a9f84aeea0 --- /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 00000000000..0f66bc06ff8 --- /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 00000000000..3a0328b516c 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 00000000000..82f1b728e71 --- /dev/null +++ b/partner_category_security_crm/static/description/index.html @@ -0,0 +1,433 @@ + + + + + +Partner category security (crm extension) + + + +
+

Partner category security (crm extension)

+ + +

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

+

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 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
  • +
+
+
+

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 00000000000..078718e8c5e --- /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 00000000000..9d3b4787d15 --- /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/_metapackage/VERSION.txt b/setup/_metapackage/VERSION.txt index 25949ffde29..279243b196c 100644 --- a/setup/_metapackage/VERSION.txt +++ b/setup/_metapackage/VERSION.txt @@ -1 +1 @@ -16.0.20240227.0 \ No newline at end of file +16.0.20240228.0 \ No newline at end of file diff --git a/setup/_metapackage/setup.py b/setup/_metapackage/setup.py index 6a068ec2aaf..d14e1aced35 100644 --- a/setup/_metapackage/setup.py +++ b/setup/_metapackage/setup.py @@ -25,6 +25,7 @@ 'odoo-addon-partner_bank_code>=16.0dev,<16.1dev', 'odoo-addon-partner_capital>=16.0dev,<16.1dev', 'odoo-addon-partner_category_security>=16.0dev,<16.1dev', + 'odoo-addon-partner_category_security_crm>=16.0dev,<16.1dev', 'odoo-addon-partner_category_type>=16.0dev,<16.1dev', 'odoo-addon-partner_company_default>=16.0dev,<16.1dev', 'odoo-addon-partner_company_group>=16.0dev,<16.1dev', 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 00000000000..a6b417747d6 --- /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 00000000000..28c57bb6403 --- /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, +)