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

9.0 [mig] marketing_security_group #128

Merged
merged 3 commits into from
Nov 25, 2016
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
58 changes: 58 additions & 0 deletions mass_mailing_security_group/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

===========================
Mass mailing security group
===========================

This module adds these security features:

* ACL for allowing marketing user group to remove mass.mailing objects
* Security rule to allow marketing user to delete only his unsent mail.mass_mailing objects
* Security rule to allow marketing manager to delete all unsent mail.mass_mailing objects

For sent mail.mass_mailing objects, only a user in Administration / Settings group
could remove them, like standard Odoo defines.


Usage
=====

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/205/9.0


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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and
welcomed feedback.

Credits
=======

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

* Rafael Blasco <rafabn@antiun.com>
* Antonio Espinosa <antonioea@antiun.com>
* Vicent Cubells <vicent.cubells@tecnativa.com>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit http://odoo-community.org.
5 changes: 5 additions & 0 deletions mass_mailing_security_group/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import wizards
22 changes: 22 additions & 0 deletions mass_mailing_security_group/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
'name': "Mass mailing security group",
'category': 'Marketing',
'version': '9.0.1.0.0',
'depends': [
'mass_mailing',
],
'external_dependencies': {},
'data': [
'security/ir.model.access.csv',
'security/mail_mass_mailing_security.xml',
],
'author': 'Tecnativa, '
'Odoo Community Association (OCA)',
'website': 'http://www.tecnativa.com',
'license': 'AGPL-3',
'installable': True,
}
24 changes: 24 additions & 0 deletions mass_mailing_security_group/i18n/de.po
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:
# * marketing_security_group
#
# Translators:
# Rudolf Schnapka <rs@techno-flex.de>, 2016
msgid ""
msgstr ""
"Project-Id-Version: social (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-01-17 01:37+0000\n"
"PO-Revision-Date: 2016-01-18 15:28+0000\n"
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n"
"Language-Team: German (http://www.transifex.com/oca/OCA-social-8-0/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: marketing_security_group
#: model:ir.model,name:marketing_security_group.model_mail_mass_mailing_test
msgid "Sample Mail Wizard"
msgstr "Beispiel-MailAssistent"
24 changes: 24 additions & 0 deletions mass_mailing_security_group/i18n/es.po
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:
# * marketing_security_group
#
# Translators:
# Antonio Trueba, 2016
msgid ""
msgstr ""
"Project-Id-Version: social (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-01-17 01:37+0000\n"
"PO-Revision-Date: 2016-02-16 12:32+0000\n"
"Last-Translator: Antonio Trueba\n"
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-social-8-0/language/es/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: marketing_security_group
#: model:ir.model,name:marketing_security_group.model_mail_mass_mailing_test
msgid "Sample Mail Wizard"
msgstr "Asistente para correo de ejemplo"
24 changes: 24 additions & 0 deletions mass_mailing_security_group/i18n/fr.po
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:
# * marketing_security_group
#
# Translators:
# Christophe CHAUVET <christophe.chauvet@gmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: social (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-30 01:07+0000\n"
"PO-Revision-Date: 2016-06-17 14:43+0000\n"
"Last-Translator: Christophe CHAUVET <christophe.chauvet@gmail.com>\n"
"Language-Team: French (http://www.transifex.com/oca/OCA-social-8-0/language/fr/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: marketing_security_group
#: model:ir.model,name:marketing_security_group.model_mail_mass_mailing_test
msgid "Sample Mail Wizard"
msgstr "Exemple d'assistant de courriel"
24 changes: 24 additions & 0 deletions mass_mailing_security_group/i18n/sl.po
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:
# * marketing_security_group
#
# Translators:
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015
msgid ""
msgstr ""
"Project-Id-Version: social (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-01-05 19:40+0000\n"
"PO-Revision-Date: 2015-12-24 06:03+0000\n"
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-social-8-0/language/sl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: sl\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"

#. module: marketing_security_group
#: model:ir.model,name:marketing_security_group.model_mail_mass_mailing_test
msgid "Sample Mail Wizard"
msgstr "Vzorec čarovnika za pošto"
2 changes: 2 additions & 0 deletions mass_mailing_security_group/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_mass_mailing_user,mail.mass_mailing.user,mass_mailing.model_mail_mass_mailing,marketing.group_lead_automation_user,1,1,1,1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">

<record id="mass_mailing_marketing_user_access" model="ir.rule">
<field name="name">Marketing user - Delete own unsent mass mailings</field>
<field name="model_id" ref="mass_mailing.model_mail_mass_mailing"/>
<field name="domain_force">[('create_uid', '=', user.id), ('state', 'in', ('draft', 'test'))]</field>
<field name="groups" eval="[(4, ref('marketing.group_lead_automation_user'))]"/>
<field eval="0" name="perm_read"/>
<field eval="0" name="perm_write"/>
<field eval="0" name="perm_create"/>
<field eval="1" name="perm_unlink"/>
</record>

<record id="mass_mailing_marketing_manager_access" model="ir.rule">
<field name="name">Marketing manager - Delete all unsent mass mailings</field>
<field name="model_id" ref="mass_mailing.model_mail_mass_mailing"/>
<field name="domain_force">[('state', 'in', ('draft', 'test'))]</field>
<field name="groups" eval="[(4, ref('marketing.group_lead_automation_manager'))]"/>
<field eval="0" name="perm_read"/>
<field eval="0" name="perm_write"/>
<field eval="0" name="perm_create"/>
<field eval="1" name="perm_unlink"/>
</record>

</odoo>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions mass_mailing_security_group/wizards/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import test_mailing
11 changes: 11 additions & 0 deletions mass_mailing_security_group/wizards/test_mailing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# © 2016 Tecnativa S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openerp import models, fields


class MailMassMailingTest(models.TransientModel):
_inherit = 'mail.mass_mailing.test'

mass_mailing_id = fields.Many2one(ondelete='cascade')