Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions survey_multi_company/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/survey/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 <https://github.com/OCA/survey/issues/new?body=module:%20survey_multi_company%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__

- 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 <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-pilarvargas-tecnativa|

This module is part of the `OCA/survey <https://github.com/OCA/survey/tree/17.0/survey_multi_company>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions survey_multi_company/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions survey_multi_company/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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",
],
}
27 changes: 27 additions & 0 deletions survey_multi_company/i18n/it.po
Original file line number Diff line number Diff line change
@@ -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 <stefano.consolaro@mymage.it>\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"
24 changes: 24 additions & 0 deletions survey_multi_company/i18n/survey_multi_company.pot
Original file line number Diff line number Diff line change
@@ -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 ""
1 change: 1 addition & 0 deletions survey_multi_company/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import survey_survey
9 changes: 9 additions & 0 deletions survey_multi_company/models/survey_survey.py
Original file line number Diff line number Diff line change
@@ -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")
3 changes: 3 additions & 0 deletions survey_multi_company/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions survey_multi_company/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [Tecnativa](https://www.tecnativa.com)
- David Vidal
- Pilar Vargas
1 change: 1 addition & 0 deletions survey_multi_company/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows to restrict surveys per company.
6 changes: 6 additions & 0 deletions survey_multi_company/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 8 additions & 0 deletions survey_multi_company/security/survey_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="survey_survey_company_rule" model="ir.rule">
<field name="name">Survey Multi Company</field>
<field name="model_id" ref="survey.model_survey_survey" />
<field name="domain_force">[("company_id", "in", [False] + company_ids)]</field>
</record>
</odoo>
Binary file added survey_multi_company/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading