diff --git a/survey_multi_company/README.rst b/survey_multi_company/README.rst new file mode 100644 index 00000000..6effe323 --- /dev/null +++ b/survey_multi_company/README.rst @@ -0,0 +1,97 @@ +==================== +Survey company rules +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a77a462cf971869e5563c25733519e35be7b4907fcb1d64e14f61a7005ffeb09 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fsurvey-lightgray.png?logo=github + :target: https://github.com/OCA/survey/tree/17.0/survey_multi_company + :alt: OCA/survey +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/survey-17-0/survey-17-0-survey_multi_company + :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/survey&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to restrict surveys per company. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To restrict a survey to a certain company: + +1. Go to to *Surveys* and select the survey you want to edit. +2. Set the desired company. + +Only the users in that company will be able to access the survey. + +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 `__ + + - David Vidal + - Pilar Vargas + +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-pilarvargas-tecnativa| image:: https://github.com/pilarvargas-tecnativa.png?size=40px + :target: https://github.com/pilarvargas-tecnativa + :alt: pilarvargas-tecnativa + +Current `maintainer `__: + +|maintainer-pilarvargas-tecnativa| + +This module is part of the `OCA/survey `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/survey_multi_company/__init__.py b/survey_multi_company/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/survey_multi_company/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/survey_multi_company/__manifest__.py b/survey_multi_company/__manifest__.py new file mode 100644 index 00000000..75e70101 --- /dev/null +++ b/survey_multi_company/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2023 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Survey company rules", + "summary": "Company security for surveys", + "version": "17.0.1.0.0", + "development_status": "Beta", + "category": "Marketing/Survey", + "website": "https://github.com/OCA/survey", + "author": "Tecnativa, Odoo Community Association (OCA)", + "maintainers": ["pilarvargas-tecnativa"], + "license": "AGPL-3", + "depends": ["survey"], + "data": [ + "views/survey_views.xml", + "security/survey_security.xml", + ], +} diff --git a/survey_multi_company/i18n/it.po b/survey_multi_company/i18n/it.po new file mode 100644 index 00000000..92349c8d --- /dev/null +++ b/survey_multi_company/i18n/it.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * survey_multi_company +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-11-17 09:34+0000\n" +"Last-Translator: mymage \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" +"X-Generator: Weblate 4.17\n" + +#. module: survey_multi_company +#: model:ir.model.fields,field_description:survey_multi_company.field_survey_survey__company_id +msgid "Company" +msgstr "Azienda" + +#. module: survey_multi_company +#: model:ir.model,name:survey_multi_company.model_survey_survey +msgid "Survey" +msgstr "Sondaggio" diff --git a/survey_multi_company/i18n/survey_multi_company.pot b/survey_multi_company/i18n/survey_multi_company.pot new file mode 100644 index 00000000..6e82ffb2 --- /dev/null +++ b/survey_multi_company/i18n/survey_multi_company.pot @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * survey_multi_company +# +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" + +#. module: survey_multi_company +#: model:ir.model.fields,field_description:survey_multi_company.field_survey_survey__company_id +msgid "Company" +msgstr "" + +#. module: survey_multi_company +#: model:ir.model,name:survey_multi_company.model_survey_survey +msgid "Survey" +msgstr "" diff --git a/survey_multi_company/models/__init__.py b/survey_multi_company/models/__init__.py new file mode 100644 index 00000000..38d56b98 --- /dev/null +++ b/survey_multi_company/models/__init__.py @@ -0,0 +1 @@ +from . import survey_survey diff --git a/survey_multi_company/models/survey_survey.py b/survey_multi_company/models/survey_survey.py new file mode 100644 index 00000000..32def3a6 --- /dev/null +++ b/survey_multi_company/models/survey_survey.py @@ -0,0 +1,9 @@ +# Copyright 2022 Tecnativa - David Vidal +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class SurveySurvey(models.Model): + _inherit = "survey.survey" + + company_id = fields.Many2one(comodel_name="res.company") diff --git a/survey_multi_company/pyproject.toml b/survey_multi_company/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/survey_multi_company/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/survey_multi_company/readme/CONTRIBUTORS.md b/survey_multi_company/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..68e9227d --- /dev/null +++ b/survey_multi_company/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Tecnativa](https://www.tecnativa.com) + - David Vidal + - Pilar Vargas diff --git a/survey_multi_company/readme/DESCRIPTION.md b/survey_multi_company/readme/DESCRIPTION.md new file mode 100644 index 00000000..e5c56a1a --- /dev/null +++ b/survey_multi_company/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module allows to restrict surveys per company. diff --git a/survey_multi_company/readme/USAGE.md b/survey_multi_company/readme/USAGE.md new file mode 100644 index 00000000..b4d9bfb2 --- /dev/null +++ b/survey_multi_company/readme/USAGE.md @@ -0,0 +1,6 @@ +To restrict a survey to a certain company: + +1. Go to to *Surveys* and select the survey you want to edit. +2. Set the desired company. + +Only the users in that company will be able to access the survey. diff --git a/survey_multi_company/security/survey_security.xml b/survey_multi_company/security/survey_security.xml new file mode 100644 index 00000000..a0236a59 --- /dev/null +++ b/survey_multi_company/security/survey_security.xml @@ -0,0 +1,8 @@ + + + + Survey Multi Company + + [("company_id", "in", [False] + company_ids)] + + diff --git a/survey_multi_company/static/description/icon.png b/survey_multi_company/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/survey_multi_company/static/description/icon.png differ diff --git a/survey_multi_company/static/description/index.html b/survey_multi_company/static/description/index.html new file mode 100644 index 00000000..d56477f9 --- /dev/null +++ b/survey_multi_company/static/description/index.html @@ -0,0 +1,439 @@ + + + + + +Survey company rules + + + +
+

Survey company rules

+ + +

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

+

This module allows to restrict surveys per company.

+

Table of contents

+ +
+

Usage

+

To restrict a survey to a certain company:

+
    +
  1. Go to to Surveys and select the survey you want to edit.
  2. +
  3. Set the desired company.
  4. +
+

Only the users in that company will be able to access the survey.

+
+
+

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

+ +
+
+

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:

+

pilarvargas-tecnativa

+

This module is part of the OCA/survey project on GitHub.

+

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

+
+
+
+ + diff --git a/survey_multi_company/views/survey_views.xml b/survey_multi_company/views/survey_views.xml new file mode 100644 index 00000000..fda64f85 --- /dev/null +++ b/survey_multi_company/views/survey_views.xml @@ -0,0 +1,12 @@ + + + + survey.survey + + + + + + + +