diff --git a/README.md b/README.md index 99defd146..bb5bdf977 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ addon | version | maintainers | summary [sale_layout_category_hide_detail](sale_layout_category_hide_detail/) | 17.0.1.0.1 | | Hide details for sections in sale orders and invoices for reports and customer portal [sale_order_line_position](sale_order_line_position/) | 17.0.1.0.0 | | Adds position number on sale order line. [sale_order_report_product_image](sale_order_report_product_image/) | 17.0.1.0.0 | | Show product images on Sale documents +[sale_report_salesman](sale_report_salesman/) | 17.0.1.0.0 | [![carolina-fernandez](https://github.com/carolina-fernandez.png?size=30px)](https://github.com/carolina-fernandez) | Adds the Sales Reporting menu to the Salespersons user group. [//]: # (end addons) diff --git a/sale_report_salesman/README.rst b/sale_report_salesman/README.rst new file mode 100644 index 000000000..572d668af --- /dev/null +++ b/sale_report_salesman/README.rst @@ -0,0 +1,88 @@ +==================== +Sale Report Salesman +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:24f29be457b8768249d3b9e87e4224cbe8d5fc42658bb64d1e1631ffd6f6d277 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fsale--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/sale-reporting/tree/17.0/sale_report_salesman + :alt: OCA/sale-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/sale-reporting-17-0/sale-reporting-17-0-sale_report_salesman + :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-reporting&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Add User: All Documents and User: Own Documents Only access to +Sales/Reporting + +**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 + +Contributors +------------ + +- `Tecnativa `__: + + - Carolina Fernandez + - Juan Carlos Oñate + +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-carolina-fernandez| image:: https://github.com/carolina-fernandez.png?size=40px + :target: https://github.com/carolina-fernandez + :alt: carolina-fernandez + +Current `maintainer `__: + +|maintainer-carolina-fernandez| + +This module is part of the `OCA/sale-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_report_salesman/__init__.py b/sale_report_salesman/__init__.py new file mode 100644 index 000000000..1ccbfaa56 --- /dev/null +++ b/sale_report_salesman/__init__.py @@ -0,0 +1 @@ +from .hooks import uninstall_hook diff --git a/sale_report_salesman/__manifest__.py b/sale_report_salesman/__manifest__.py new file mode 100644 index 000000000..6d9a13e87 --- /dev/null +++ b/sale_report_salesman/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2024 Tecnativa - Carolina Fernandez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Sale Report Salesman", + "summary": "Adds the Sales Reporting menu to the Salespersons user group.", + "version": "17.0.1.0.0", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/sale-reporting", + "category": "Sales", + "license": "AGPL-3", + "data": ["views/menu_views.xml"], + "depends": ["sale", "sales_team"], + "installable": True, + "maintainers": ["carolina-fernandez"], + "auto_install": True, + "uninstall_hook": "uninstall_hook", +} diff --git a/sale_report_salesman/hooks.py b/sale_report_salesman/hooks.py new file mode 100644 index 000000000..8fc0a26ba --- /dev/null +++ b/sale_report_salesman/hooks.py @@ -0,0 +1,12 @@ +# Copyright 2024 Tecnativa - Carolina Fernandez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +def uninstall_hook(env): + menu_sale_report = env.ref("sale.menu_sale_report", raise_if_not_found=False) + if menu_sale_report: + group_salesman = env.ref( + "sales_team.group_sale_salesman", raise_if_not_found=False + ) + if group_salesman: + menu_sale_report.write({"groups_id": [(3, group_salesman.id)]}) diff --git a/sale_report_salesman/i18n/es.po b/sale_report_salesman/i18n/es.po new file mode 100644 index 000000000..e69de29bb diff --git a/sale_report_salesman/i18n/sale_report_salesman.pot b/sale_report_salesman/i18n/sale_report_salesman.pot new file mode 100644 index 000000000..716a0702d --- /dev/null +++ b/sale_report_salesman/i18n/sale_report_salesman.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 17.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/sale_report_salesman/pyproject.toml b/sale_report_salesman/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/sale_report_salesman/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/sale_report_salesman/readme/CONTRIBUTORS.md b/sale_report_salesman/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..f8332aca9 --- /dev/null +++ b/sale_report_salesman/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- [Tecnativa](https://www.tecnativa.com): + + > - Carolina Fernandez + > - Juan Carlos Oñate diff --git a/sale_report_salesman/readme/DESCRIPTION.md b/sale_report_salesman/readme/DESCRIPTION.md new file mode 100644 index 000000000..22b097342 --- /dev/null +++ b/sale_report_salesman/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +Add User: All Documents and User: Own Documents Only access to +Sales/Reporting diff --git a/sale_report_salesman/static/description/icon.png b/sale_report_salesman/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/sale_report_salesman/static/description/icon.png differ diff --git a/sale_report_salesman/static/description/index.html b/sale_report_salesman/static/description/index.html new file mode 100644 index 000000000..372cccd56 --- /dev/null +++ b/sale_report_salesman/static/description/index.html @@ -0,0 +1,433 @@ + + + + + +Sale Report Salesman + + + +
+

Sale Report Salesman

+ + +

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

+

Add User: All Documents and User: Own Documents Only access to +Sales/Reporting

+

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

Contributors

+
    +
  • Tecnativa:

    +
    +
      +
    • Carolina Fernandez
    • +
    • Juan Carlos Oñate
    • +
    +
    +
  • +
+
+
+

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:

+

carolina-fernandez

+

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

+

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

+
+
+
+ + diff --git a/sale_report_salesman/tests/__init__.py b/sale_report_salesman/tests/__init__.py new file mode 100644 index 000000000..7ec5d31e5 --- /dev/null +++ b/sale_report_salesman/tests/__init__.py @@ -0,0 +1 @@ +from . import test_uninstall_hook diff --git a/sale_report_salesman/tests/test_uninstall_hook.py b/sale_report_salesman/tests/test_uninstall_hook.py new file mode 100644 index 000000000..f615e4754 --- /dev/null +++ b/sale_report_salesman/tests/test_uninstall_hook.py @@ -0,0 +1,19 @@ +# Copyright 2024 Tecnativa - Carolina Fernandez +from odoo.tests.common import TransactionCase + +from ..hooks import uninstall_hook + + +class TestUninstallHook(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.group_sale_salesman = cls.env.ref("sales_team.group_sale_salesman") + + def test_uninstall_hook(self): + menu_sale_report = self.env.ref( + "sale.menu_sale_report", raise_if_not_found=False + ) + self.assertIn(self.group_sale_salesman, menu_sale_report.groups_id) + uninstall_hook(self.env) + self.assertNotIn(self.group_sale_salesman, menu_sale_report.groups_id) diff --git a/sale_report_salesman/views/menu_views.xml b/sale_report_salesman/views/menu_views.xml new file mode 100644 index 000000000..b0aeb13b6 --- /dev/null +++ b/sale_report_salesman/views/menu_views.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/setup/_metapackage/pyproject.toml b/setup/_metapackage/pyproject.toml index d262495e2..d8ce1ae2d 100644 --- a/setup/_metapackage/pyproject.toml +++ b/setup/_metapackage/pyproject.toml @@ -1,11 +1,12 @@ [project] name = "odoo-addons-oca-sale-reporting" -version = "17.0.20241004.0" +version = "17.0.20250221.0" dependencies = [ "odoo-addon-sale_comment_template>=17.0dev,<17.1dev", "odoo-addon-sale_layout_category_hide_detail>=17.0dev,<17.1dev", "odoo-addon-sale_order_line_position>=17.0dev,<17.1dev", "odoo-addon-sale_order_report_product_image>=17.0dev,<17.1dev", + "odoo-addon-sale_report_salesman>=17.0dev,<17.1dev", ] classifiers=[ "Programming Language :: Python",