Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[12.0][MIG] Backport from 14.0 to 12.0 crm_security_group #597

Open
wants to merge 18 commits into
base: 12.0
Choose a base branch
from
Open
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
91 changes: 91 additions & 0 deletions crm_security_group/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
========================
CRM Only Security Groups
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:340ce96f2ac6036e579f10556dbafb3172e1fefd14561b6af3470fc796726894
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Fcrm-lightgray.png?logo=github
:target: https://github.com/OCA/crm/tree/14.0/crm_security_group
:alt: OCA/crm
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/crm-14-0/crm-14-0-crm_security_group
: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/crm&target_branch=14.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds new security options to CRM by creating 3 groups (Own Documents Only, All Documents and Administrator) to separate Sales and CRM apps permissions

**Table of contents**

.. contents::
:local:

Known issues / Roadmap
======================

- Remove sale_crm dependency (now is not possible), maybe split these part in other addon

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/crm/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/crm/issues/new?body=module:%20crm_security_group%0Aversion:%2014.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>`__:

* Víctor Martínez

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

|maintainer-victoralmau|

This module is part of the `OCA/crm <https://github.com/OCA/crm/tree/14.0/crm_security_group>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Empty file added crm_security_group/__init__.py
Empty file.
21 changes: 21 additions & 0 deletions crm_security_group/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2021 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "CRM Only Security Groups",
"summary": "Add new group in Sales to show only CRM",
"version": "12.0.1.0.0",
"category": "Customer Relationship Management",
"website": "https://github.com/OCA/crm",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["crm", "sale_crm"],
# sale_crm dependency is necessary to add groups in some view
"maintainers": ["victoralmau"],
"data": [
"security/security.xml",
"security/ir.model.access.csv",
"views/menu_items.xml",
],
}
34 changes: 34 additions & 0 deletions crm_security_group/i18n/crm_security_group.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_security_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.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: crm_security_group
#: model:res.groups,name:crm_security_group.group_crm_manager
msgid "Administrator"
msgstr ""

#. module: crm_security_group
#: model:ir.module.category,name:crm_security_group.module_category_crm_crm
msgid "CRM"
msgstr ""

#. module: crm_security_group
#: model:res.groups,name:crm_security_group.group_crm_all_leads
msgid "User: All Documents"
msgstr ""

#. module: crm_security_group
#: model:res.groups,name:crm_security_group.group_crm_own_leads
msgid "User: Own Documents Only"
msgstr ""
37 changes: 37 additions & 0 deletions crm_security_group/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_security_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-06-06 11:08+0000\n"
"Last-Translator: luis-ron <[email protected]>\n"
"Language-Team: none\n"
"Language: es\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: crm_security_group
#: model:res.groups,name:crm_security_group.group_crm_manager
msgid "Administrator"
msgstr "Administrador"

#. module: crm_security_group
#: model:ir.module.category,name:crm_security_group.module_category_crm_crm
msgid "CRM"
msgstr "CRM"

#. module: crm_security_group
#: model:res.groups,name:crm_security_group.group_crm_all_leads
msgid "User: All Documents"
msgstr "Usuario: Todos los documentos"

#. module: crm_security_group
#: model:res.groups,name:crm_security_group.group_crm_own_leads
msgid "User: Own Documents Only"
msgstr "Usuario: Mostrar solo documentos propios"
37 changes: 37 additions & 0 deletions crm_security_group/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_security_group
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-06-13 16:09+0000\n"
"Last-Translator: mymage <[email protected]>\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: crm_security_group
#: model:res.groups,name:crm_security_group.group_crm_manager
msgid "Administrator"
msgstr "Amministratore"

#. module: crm_security_group
#: model:ir.module.category,name:crm_security_group.module_category_crm_crm
msgid "CRM"
msgstr "CRM"

#. module: crm_security_group
#: model:res.groups,name:crm_security_group.group_crm_all_leads
msgid "User: All Documents"
msgstr "Utente: tutti i documenti"

#. module: crm_security_group
#: model:res.groups,name:crm_security_group.group_crm_own_leads
msgid "User: Own Documents Only"
msgstr "Utente: solo i propri documenti"
3 changes: 3 additions & 0 deletions crm_security_group/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Tecnativa <https://www.tecnativa.com>`__:

* Víctor Martínez
1 change: 1 addition & 0 deletions crm_security_group/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds new security options to CRM by creating 3 groups (Own Documents Only, All Documents and Administrator) to separate Sales and CRM apps permissions
1 change: 1 addition & 0 deletions crm_security_group/readme/ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Remove sale_crm dependency (now is not possible), maybe split these part in other addon
5 changes: 5 additions & 0 deletions crm_security_group/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_crm_lead_user,crm.lead.user,crm.model_crm_lead,crm_security_group.group_crm_own_leads,1,1,1,0
access_crm_team_user,crm.team.user,sales_team.model_crm_team,crm_security_group.group_crm_own_leads,1,0,0,0
access_crm_team_manager,crm.team.manager,sales_team.model_crm_team,crm_security_group.group_crm_manager,1,1,1,1
access_crm_stage_manager,crm.stage.manager,crm.model_crm_stage,crm_security_group.group_crm_manager,1,1,1,1
54 changes: 54 additions & 0 deletions crm_security_group/security/security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="module_category_crm_crm" model="ir.module.category">
<field name="name">CRM</field>
<field name="parent_id" ref="base.module_category_sales" />
</record>
<record id="group_crm_own_leads" model="res.groups">
<field name="name">User: Own Documents Only</field>
<field name="category_id" ref="crm_security_group.module_category_crm_crm" />
<field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
</record>
<record id="group_crm_all_leads" model="res.groups">
<field name="name">User: All Documents</field>
<field name="category_id" ref="crm_security_group.module_category_crm_crm" />
<field
name="implied_ids"
eval="[(4, ref('crm_security_group.group_crm_own_leads'))]"
/>
</record>
<record id="group_crm_manager" model="res.groups">
<field name="name">Administrator</field>
<field name="category_id" ref="crm_security_group.module_category_crm_crm" />
<field
name="implied_ids"
eval="[(4, ref('crm_security_group.group_crm_all_leads'))]"
/>
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>
<data noupdate="1">
<record id="crm_personal_rule" model="ir.rule">
<field name="name">Personal Leads</field>
<field name="model_id" ref="crm.model_crm_lead" />
<field
name="domain_force"
>['|',('user_id','=',user.id),('user_id','=',False)]</field>
<field
name="groups"
eval="[(4, ref('crm_security_group.group_crm_own_leads'))]"
/>
</record>
<record id="crm_see_all" model="ir.rule">
<field name="name">All Leads</field>
<field name="model_id" ref="crm.model_crm_lead" />
<field name="domain_force">[(1,'=',1)]</field>
<field
name="groups"
eval="[(4, ref('crm_security_group.group_crm_all_leads'))]"
/>
</record>
</data>
</odoo>
Binary file added crm_security_group/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
Loading