From 21980aecddc3429b0cba5a0addc733828574b158 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 8 Aug 2018 15:15:57 +0100 Subject: [PATCH] [ADD] privacy_consent: Privacy explicit consent tracking tools (#11) --- privacy/__init__.py | 2 +- privacy/__manifest__.py | 9 + privacy/demo/res_users.xml | 10 + privacy/i18n/es.po | 201 ++++++++++++++++++++ privacy/models/__init__.py | 1 + privacy/models/privacy_activity.py | 52 +++++ privacy/readme/CONFIGURATION.rst | 2 + privacy/readme/USAGE.rst | 9 +- privacy/security/data_protection.xml | 4 + privacy/security/ir.model.access.csv | 3 + privacy/views/data_protection_menu_view.xml | 6 +- privacy/views/privacy_activity_view.xml | 127 +++++++++++++ 12 files changed, 417 insertions(+), 9 deletions(-) create mode 100644 privacy/demo/res_users.xml create mode 100644 privacy/i18n/es.po create mode 100644 privacy/models/__init__.py create mode 100644 privacy/models/privacy_activity.py create mode 100644 privacy/readme/CONFIGURATION.rst create mode 100644 privacy/security/ir.model.access.csv create mode 100644 privacy/views/privacy_activity_view.xml diff --git a/privacy/__init__.py b/privacy/__init__.py index b7db254..0650744 100644 --- a/privacy/__init__.py +++ b/privacy/__init__.py @@ -1 +1 @@ -# Empty +from . import models diff --git a/privacy/__manifest__.py b/privacy/__manifest__.py index a28051f..e2b86e5 100644 --- a/privacy/__manifest__.py +++ b/privacy/__manifest__.py @@ -7,12 +7,21 @@ 'summary': 'Provides data privacy and protection features ' 'to comply to regulations, such as GDPR.', 'author': "Eficent, " + "Tecnativa, " "Odoo Community Association (OCA)", 'website': 'http://www.github.com/OCA/data-protection', 'license': 'AGPL-3', 'data': [ 'security/data_protection.xml', + 'security/ir.model.access.csv', 'views/data_protection_menu_view.xml', + 'views/privacy_activity_view.xml', + ], + 'demo': [ + 'demo/res_users.xml', + ], + 'depends': [ + 'mail', ], 'installable': True, 'application': True, diff --git a/privacy/demo/res_users.xml b/privacy/demo/res_users.xml new file mode 100644 index 0000000..9977342 --- /dev/null +++ b/privacy/demo/res_users.xml @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/privacy/i18n/es.po b/privacy/i18n/es.po new file mode 100644 index 0000000..9d688c7 --- /dev/null +++ b/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 \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." diff --git a/privacy/models/__init__.py b/privacy/models/__init__.py new file mode 100644 index 0000000..757e8da --- /dev/null +++ b/privacy/models/__init__.py @@ -0,0 +1 @@ +from . import privacy_activity diff --git a/privacy/models/privacy_activity.py b/privacy/models/privacy_activity.py new file mode 100644 index 0000000..d3670d9 --- /dev/null +++ b/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 diff --git a/privacy/readme/CONFIGURATION.rst b/privacy/readme/CONFIGURATION.rst new file mode 100644 index 0000000..f754478 --- /dev/null +++ b/privacy/readme/CONFIGURATION.rst @@ -0,0 +1,2 @@ +In the "Privacy", open the "Settings" menu to find and enable +the main features available. diff --git a/privacy/readme/USAGE.rst b/privacy/readme/USAGE.rst index 3c336a4..85a4dca 100644 --- a/privacy/readme/USAGE.rst +++ b/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! diff --git a/privacy/security/data_protection.xml b/privacy/security/data_protection.xml index 26f6371..4a2ed9c 100644 --- a/privacy/security/data_protection.xml +++ b/privacy/security/data_protection.xml @@ -22,5 +22,9 @@ + + + + diff --git a/privacy/security/ir.model.access.csv b/privacy/security/ir.model.access.csv new file mode 100644 index 0000000..68a0950 --- /dev/null +++ b/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 diff --git a/privacy/views/data_protection_menu_view.xml b/privacy/views/data_protection_menu_view.xml index f4db022..3be7de2 100644 --- a/privacy/views/data_protection_menu_view.xml +++ b/privacy/views/data_protection_menu_view.xml @@ -1,7 +1,6 @@ - @@ -9,9 +8,7 @@ ir.actions.act_window res.partner form - tree,form - [] - + kanban,tree,form - diff --git a/privacy/views/privacy_activity_view.xml b/privacy/views/privacy_activity_view.xml new file mode 100644 index 0000000..50da021 --- /dev/null +++ b/privacy/views/privacy_activity_view.xml @@ -0,0 +1,127 @@ + + + + + + Privacy Activity Form + privacy.activity + +
+
+ +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+ + + Privacy Activity Tree + privacy.activity + + + + + + + + + + + Privacy Activity Search + privacy.activity + + + + + + + + + + + + + + + + + Activities + privacy.activity + tree,form + +

+ Click to add a data processing activity. +

+ Data processing activities define why, how and what you do + with subjects' personal data. +

+
+
+ + + +