Browse Source

[ADD] privacy_consent: Privacy explicit consent tracking tools (#11)

pull/50/head
Jairo Llopis 6 years ago
committed by Jairo Llopis
parent
commit
21980aecdd
No known key found for this signature in database GPG Key ID: 8B8A6900E4831A9B
  1. 2
      privacy/__init__.py
  2. 9
      privacy/__manifest__.py
  3. 10
      privacy/demo/res_users.xml
  4. 201
      privacy/i18n/es.po
  5. 1
      privacy/models/__init__.py
  6. 52
      privacy/models/privacy_activity.py
  7. 2
      privacy/readme/CONFIGURATION.rst
  8. 9
      privacy/readme/USAGE.rst
  9. 4
      privacy/security/data_protection.xml
  10. 3
      privacy/security/ir.model.access.csv
  11. 6
      privacy/views/data_protection_menu_view.xml
  12. 127
      privacy/views/privacy_activity_view.xml

2
privacy/__init__.py

@ -1 +1 @@
# Empty
from . import models

9
privacy/__manifest__.py

@ -7,12 +7,21 @@
'summary': 'Provides data privacy and protection features ' 'summary': 'Provides data privacy and protection features '
'to comply to regulations, such as GDPR.', 'to comply to regulations, such as GDPR.',
'author': "Eficent, " 'author': "Eficent, "
"Tecnativa, "
"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
'website': 'http://www.github.com/OCA/data-protection', 'website': 'http://www.github.com/OCA/data-protection',
'license': 'AGPL-3', 'license': 'AGPL-3',
'data': [ 'data': [
'security/data_protection.xml', 'security/data_protection.xml',
'security/ir.model.access.csv',
'views/data_protection_menu_view.xml', 'views/data_protection_menu_view.xml',
'views/privacy_activity_view.xml',
],
'demo': [
'demo/res_users.xml',
],
'depends': [
'mail',
], ],
'installable': True, 'installable': True,
'application': True, 'application': True,

10
privacy/demo/res_users.xml

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 Tecnativa - Jairo Llopis
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<data>
<record id="base.user_demo" model="res.users">
<field name="groups_id" eval="[(4, ref('group_data_protection_user'))]"/>
</record>
</data>

201
privacy/i18n/es.po

@ -0,0 +1,201 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * privacy
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-11 08:39+0000\n"
"PO-Revision-Date: 2018-07-11 10:46+0200\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.8\n"
"Last-Translator: Jairo Llopis <yajo.sk8@gmail.com>\n"
"Language: es_ES\n"
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_active
msgid "Active"
msgstr "Activa"
#. module: privacy
#: model:ir.actions.act_window,name:privacy.activity_action
#: model:ir.ui.menu,name:privacy.menu_privacy_activity
msgid "Activities"
msgstr "Actividades"
#. module: privacy
#: model:ir.ui.view,arch_db:privacy.activity_search
msgid "Archived"
msgstr "Archivada"
#. module: privacy
#: model:ir.model.fields,help:privacy.field_privacy_activity_subject_find
msgid "Are affected subjects present in this database?"
msgstr "¿Los sujetos interesados se encuentran en esta base de datos?"
#. module: privacy
#: model:ir.actions.act_window,help:privacy.activity_action
msgid "Click to add a data processing activity."
msgstr "Pulse para añadir una actividad de tratamiento de datos."
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_controller_id
#: model:ir.ui.view,arch_db:privacy.activity_search
msgid "Controller"
msgstr "Responsable"
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_create_uid
msgid "Created by"
msgstr "Creado por"
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_create_date
msgid "Created on"
msgstr "Creado el"
#. module: privacy
#: model:ir.module.category,name:privacy.module_category_data_protection
msgid "Data Protection"
msgstr "Protección de datos"
#. module: privacy
#: model:res.groups,name:privacy.group_data_protection_manager
msgid "Data Protection Manager"
msgstr "Gestor de protección de datos"
#. module: privacy
#: model:res.groups,name:privacy.group_data_protection_user
msgid "Data Protection User"
msgstr "Usuario de protección de datos"
#. module: privacy
#: model:ir.model,name:privacy.model_privacy_activity
msgid "Data processing activities"
msgstr "Actividades de tratamiento de datos"
#. module: privacy
#: model:ir.actions.act_window,help:privacy.activity_action
msgid ""
"Data processing activities define why, how and what you do\n"
" with subjects' personal data."
msgstr ""
"Las actividades de tratamiento definen por qué, cómo y qué se hace\n"
"\t\tcon los datos personales de los interesados."
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_subject_find
msgid "Define subjects"
msgstr "Definir interesados"
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_description
#: model:ir.ui.view,arch_db:privacy.activity_form
msgid "Description"
msgstr "Descripción"
#. module: privacy
#: model:ir.ui.view,arch_db:privacy.activity_form
msgid "Details"
msgstr "Detalles"
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_display_name
msgid "Display Name"
msgstr "Nombre a mostrar"
#. module: privacy
#: model:ir.ui.view,arch_db:privacy.activity_search
msgid "Group By"
msgstr "Agrupar por"
#. module: privacy
#: model:ir.model.fields,help:privacy.field_privacy_activity_description
msgid "How is personal data used here? Why? Etc."
msgstr "¿Cómo se usan los datos personales aquí? ¿Por qué? Etc."
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_id
msgid "ID"
msgstr "ID"
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity___last_update
msgid "Last Modified on"
msgstr "Última modificación en"
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_write_uid
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_write_date
msgid "Last Updated on"
msgstr "Última actualización el"
#. module: privacy
#: model:ir.ui.menu,name:privacy.menu_data_protection_master_data
msgid "Master Data"
msgstr "Datos maestros"
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_name
msgid "Name"
msgstr "Nombre"
#. module: privacy
#: model:ir.actions.act_window,name:privacy.action_data_protection_partner_form
#: model:ir.ui.menu,name:privacy.menu_data_protection_partner
msgid "Partners"
msgstr "Contactos"
#. module: privacy
#: model:ir.ui.menu,name:privacy.parent_menu_data_protection
msgid "Privacy"
msgstr "Privacidad"
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_processor_ids
msgid "Processors"
msgstr "Encargados del tratamiento"
#. module: privacy
#: model:ir.ui.menu,name:privacy.menu_data_protection_report
msgid "Reports"
msgstr "Informes"
#. module: privacy
#: model:ir.model.fields,help:privacy.field_privacy_activity_subject_domain
msgid "Selection filter to find specific subjects included."
msgstr "Filtro de selección para encontrar los interesados específicos incluidos."
#. module: privacy
#: model:ir.ui.menu,name:privacy.menu_data_protection_setting
msgid "Settings"
msgstr "Configuración"
#. module: privacy
#: model:ir.model.fields,field_description:privacy.field_privacy_activity_subject_domain
msgid "Subjects filter"
msgstr "Filtro de interesados"
#. module: privacy
#: model:ir.ui.menu,name:privacy.menu_data_protection_transaction
msgid "Transactions"
msgstr "Transacciones"
#. module: privacy
#: model:ir.model.fields,help:privacy.field_privacy_activity_controller_id
msgid "Whoever determines the purposes and means of the processing of personal data."
msgstr "Quien determina los propósitos y medios del procesamiento de datos personales."
#. module: privacy
#: model:ir.model.fields,help:privacy.field_privacy_activity_processor_ids
msgid "Whoever processes personal data on behalf of the controller."
msgstr "Quien procesa los datos personales en nombre del responsable."

1
privacy/models/__init__.py

@ -0,0 +1 @@
from . import privacy_activity

52
privacy/models/privacy_activity.py

@ -0,0 +1,52 @@
# Copyright 2018 Tecnativa - Jairo Llopis
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class PrivacyActivity(models.Model):
_name = "privacy.activity"
_description = "Data processing activities"
_inherit = "mail.thread"
active = fields.Boolean(
default=True,
index=True,
)
name = fields.Char(
index=True,
required=True,
translate=True,
)
description = fields.Html(
translate=True,
help="How is personal data used here? Why? Etc."
)
controller_id = fields.Many2one(
"res.partner",
string="Controller",
required=True,
default=lambda self: self._default_controller_id(),
help="Whoever determines the purposes and means of the processing "
"of personal data.",
)
processor_ids = fields.Many2many(
"res.partner",
"privacy_activity_res_partner_processor_ids",
string="Processors",
help="Whoever processes personal data on behalf of the controller.",
)
subject_find = fields.Boolean(
"Define subjects",
help="Are affected subjects present in this database?",
)
subject_domain = fields.Char(
"Subjects filter",
default="[]",
help="Selection filter to find specific subjects included.",
)
@api.model
def _default_controller_id(self):
"""By default it should be the current user's company."""
return self.env.user.company_id

2
privacy/readme/CONFIGURATION.rst

@ -0,0 +1,2 @@
In the "Privacy", open the "Settings" menu to find and enable
the main features available.

9
privacy/readme/USAGE.rst

@ -1,3 +1,6 @@
#. Go to "Data Protection" Application
#. Go to Configuration > "Settings" menu
#. Enable the main features available.
To define data processing activities:
#. Go to *Privacy > Master Data > Activities* and create one.
#. Define the data processing activity using the provided tools.
Consult your lawyer!

4
privacy/security/data_protection.xml

@ -22,5 +22,9 @@
<field name="users" eval="[(4, ref('base.user_root'))]"/> <field name="users" eval="[(4, ref('base.user_root'))]"/>
</record> </record>
<record id="base.user_root" model="res.users">
<field name="groups_id" eval="[(4, ref('group_data_protection_manager'))]"/>
</record>
</data> </data>
</odoo> </odoo>

3
privacy/security/ir.model.access.csv

@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
read,Permission to read activities,model_privacy_activity,group_data_protection_user,1,0,0,0
write,Permission to write activities,model_privacy_activity,group_data_protection_manager,1,1,1,1

6
privacy/views/data_protection_menu_view.xml

@ -1,7 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- Copyright 2018 Eficent Business and IT Consulting Services S.L. <!-- Copyright 2018 Eficent Business and IT Consulting Services S.L.
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) --> License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
<data> <data>
<record id="action_data_protection_partner_form" model="ir.actions.act_window"> <record id="action_data_protection_partner_form" model="ir.actions.act_window">
@ -9,9 +8,7 @@
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner</field> <field name="res_model">res.partner</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="filter" eval="True"/>
<field name="view_mode">kanban,tree,form</field>
</record> </record>
<menuitem id="parent_menu_data_protection" <menuitem id="parent_menu_data_protection"
@ -62,4 +59,3 @@
/> />
</data> </data>
</odoo>

127
privacy/views/privacy_activity_view.xml

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2018 Tecnativa - Jairo Llopis
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<data>
<record model="ir.ui.view" id="activity_form">
<field name="name">Privacy Activity Form</field>
<field name="model">privacy.activity</field>
<field name="arch" type="xml">
<form>
<header>
<!-- Placeholder for submodules -->
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button
class="oe_stat_button"
icon="fa-archive"
name="toggle_active"
type="object"
>
<field
name="active"
options='{"terminology": "archive"}'
widget="boolean_button"
/>
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
</div>
<group name="basic">
<group name="owners">
<field name="controller_id"/>
<field
name="processor_ids"
widget="many2many_tags"
/>
</group>
<group name="subjects">
<field name="subject_find"/>
<field
name="subject_domain"
widget="char_domain"
options='{"model": "res.partner"}'
attrs='{"required": [("subject_find", "=", True)],
"invisible": [("subject_find", "=", False)]}'
/>
</group>
</group>
<notebook string="Details" name="advanced">
<page string="Description">
<group>
<field name="description" nolabel="1"/>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record model="ir.ui.view" id="activity_tree">
<field name="name">Privacy Activity Tree</field>
<field name="model">privacy.activity</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="controller_id"/>
<field name="processor_ids"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="activity_search">
<field name="name">Privacy Activity Search</field>
<field name="model">privacy.activity</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="controller_id"/>
<field name="processor_ids"/>
<separator/>
<filter
string="Archived"
name="inactive"
domain="[('active', '=', False)]"
/>
<separator/>
<group string="Group By" name="groupby">
<filter
name="controller_id_groupby"
string="Controller"
context="{'group_by': 'controller_id'}"
/>
</group>
</search>
</field>
</record>
<record id="activity_action" model="ir.actions.act_window">
<field name="name">Activities</field>
<field name="res_model">privacy.activity</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a data processing activity.
</p><p>
Data processing activities define why, how and what you do
with subjects' personal data.
</p>
</field>
</record>
<menuitem
action="activity_action"
groups="group_data_protection_user"
id="menu_privacy_activity"
parent="menu_data_protection_master_data"
/>
</data>
Loading…
Cancel
Save