Browse Source

[IMP] privacy: pre-commit run

pull/55/head
Jairo Llopis 3 years ago
committed by Valtteri Lattu
parent
commit
f74459a745
  1. 40
      privacy/__manifest__.py
  2. 6
      privacy/demo/res_users.xml
  3. 21
      privacy/models/privacy_activity.py
  4. 25
      privacy/security/data_protection.xml
  5. 73
      privacy/views/data_protection_menu_view.xml
  6. 82
      privacy/views/privacy_activity_view.xml

40
privacy/__manifest__.py

@ -1,28 +1,22 @@
# Copyright 2018 Eficent Business and IT Consulting Services S.L.
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Data Privacy and Protection',
'version': '12.0.1.1.0',
'category': 'Data Protection',
'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',
"name": "Data Privacy and Protection",
"version": "12.0.1.1.0",
"category": "Data Protection",
"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,
"demo": ["demo/res_users.xml"],
"depends": ["mail"],
"installable": True,
"application": True,
}

6
privacy/demo/res_users.xml

@ -1,10 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?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'))]"/>
<field name="groups_id" eval="[(4, ref('group_data_protection_user'))]" />
</record>
</data>

21
privacy/models/privacy_activity.py

@ -7,20 +7,12 @@ from odoo import api, fields, models
class PrivacyActivity(models.Model):
_name = "privacy.activity"
_description = "Data processing activities"
_inherit = ['mail.thread', 'mail.activity.mixin']
_inherit = ["mail.thread", "mail.activity.mixin"]
active = fields.Boolean(
default=True,
index=True,
)
name = fields.Char(
index=True,
required=True,
translate=True,
)
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."
translate=True, help="How is personal data used here? Why? Etc."
)
controller_id = fields.Many2one(
"res.partner",
@ -28,7 +20,7 @@ class PrivacyActivity(models.Model):
required=True,
default=lambda self: self._default_controller_id(),
help="Whoever determines the purposes and means of the processing "
"of personal data.",
"of personal data.",
)
processor_ids = fields.Many2many(
"res.partner",
@ -37,8 +29,7 @@ class PrivacyActivity(models.Model):
help="Whoever processes personal data on behalf of the controller.",
)
subject_find = fields.Boolean(
"Define subjects",
help="Are affected subjects present in this database?",
"Define subjects", help="Are affected subjects present in this database?",
)
subject_domain = fields.Char(
"Subjects filter",

25
privacy/security/data_protection.xml

@ -1,30 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018 Eficent Business and IT Consulting Services S.L.
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
<data noupdate="0">
<record model="ir.module.category" id="module_category_data_protection">
<field name="name">Data Protection</field>
<field name="sequence">30</field>
</record>
<record id="group_data_protection_user" model="res.groups">
<field name="name">Data Protection User</field>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
<field name="category_id" ref="module_category_data_protection"/>
<field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
<field name="category_id" ref="module_category_data_protection" />
</record>
<record id="group_data_protection_manager" model="res.groups">
<field name="name">Data Protection Manager</field>
<field name="implied_ids" eval="[(4, ref('privacy.group_data_protection_user'))]"/>
<field name="category_id" ref="module_category_data_protection"/>
<field name="users" eval="[(4, ref('base.user_root'))]"/>
<field
name="implied_ids"
eval="[(4, ref('privacy.group_data_protection_user'))]"
/>
<field name="category_id" ref="module_category_data_protection" />
<field name="users" eval="[(4, ref('base.user_root'))]" />
</record>
<record id="base.user_root" model="res.users">
<field name="groups_id" eval="[(4, ref('group_data_protection_manager'))]"/>
<field
name="groups_id"
eval="[(4, ref('group_data_protection_manager'))]"
/>
</record>
</data>
</odoo>

73
privacy/views/data_protection_menu_view.xml

@ -1,8 +1,7 @@
<?xml version="1.0"?>
<?xml version="1.0" ?>
<!-- Copyright 2018 Eficent Business and IT Consulting Services S.L.
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0) -->
<data>
<record id="action_data_protection_partner_form" model="ir.actions.act_window">
<field name="name">Partners</field>
<field name="type">ir.actions.act_window</field>
@ -10,38 +9,40 @@
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
</record>
<menuitem id="parent_menu_data_protection"
name="Privacy"
groups="group_data_protection_user"
web_icon="privacy,static/description/icon.png"
<menuitem
id="parent_menu_data_protection"
name="Privacy"
groups="group_data_protection_user"
web_icon="privacy,static/description/icon.png"
/>
<menuitem id="menu_data_protection_master_data"
name="Master Data"
parent="parent_menu_data_protection"
groups="group_data_protection_user"
sequence="10"
<menuitem
id="menu_data_protection_master_data"
name="Master Data"
parent="parent_menu_data_protection"
groups="group_data_protection_user"
sequence="10"
/>
<menuitem id="menu_data_protection_partner"
name="Partners"
parent="menu_data_protection_master_data"
action="action_data_protection_partner_form"
sequence="1010"
<menuitem
id="menu_data_protection_partner"
name="Partners"
parent="menu_data_protection_master_data"
action="action_data_protection_partner_form"
sequence="1010"
/>
<menuitem id="menu_data_protection_transaction"
name="Transactions"
parent="parent_menu_data_protection"
groups="group_data_protection_user"
sequence="20"
<menuitem
id="menu_data_protection_transaction"
name="Transactions"
parent="parent_menu_data_protection"
groups="group_data_protection_user"
sequence="20"
/>
<menuitem id="menu_data_protection_report"
name="Reports"
parent="parent_menu_data_protection"
groups="group_data_protection_user"
sequence="30"
<menuitem
id="menu_data_protection_report"
name="Reports"
parent="parent_menu_data_protection"
groups="group_data_protection_user"
sequence="30"
/>
<record id="action_data_protection_config" model="ir.actions.act_window">
<field name="name">Data Protection Settings</field>
<field name="type">ir.actions.act_window</field>
@ -50,12 +51,12 @@
<field name="target">inline</field>
<field name="context">{'module': 'data_protection'}</field>
</record>
<menuitem id="menu_data_protection_setting"
name="Settings"
parent="parent_menu_data_protection"
action="action_data_protection_config"
groups="group_data_protection_manager"
sequence="90"
<menuitem
id="menu_data_protection_setting"
name="Settings"
parent="parent_menu_data_protection"
action="action_data_protection_config"
groups="group_data_protection_manager"
sequence="90"
/>
</data>

82
privacy/views/privacy_activity_view.xml

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<?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>
@ -27,86 +26,83 @@
</button>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
<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="controller_id" />
</group>
<group name="dates">
<field name="create_date" readonly="1"/>
<field name="write_date" readonly="1"/>
<field name="write_uid" readonly="1"/>
<field name="create_date" readonly="1" />
<field name="write_date" readonly="1" />
<field name="write_uid" readonly="1" />
</group>
</group>
<separator name="subjects" string="Subjects details"/>
<separator name="subjects" string="Subjects details" />
<group name="subjects">
<field name="subject_find"/>
<field
name="subject_domain"
widget="domain"
options='{"model": "res.partner"}'
attrs='{"required": [("subject_find", "=", True)],
<field name="subject_find" />
<field
name="subject_domain"
widget="domain"
options='{"model": "res.partner"}'
attrs='{"required": [("subject_find", "=", True)],
"invisible": [("subject_find", "=", False)]}'
/>
/>
</group>
<separator name="processors" string="Processors"/>
<separator name="processors" string="Processors" />
<group name="processors">
<field
name="processor_ids"
widget="many2many"
>
<tree string="processors">
<field name="name"/>
<field name="email"/>
<field name="country_id"/>
</tree>
</field>
<field name="processor_ids" widget="many2many">
<tree string="processors">
<field name="name" />
<field name="email" />
<field name="country_id" />
</tree>
</field>
</group>
<notebook string="Details" name="advanced">
<page string="Description">
<group>
<field name="description" nolabel="1"/>
<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"/>
<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"/>
<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/>
<field name="name" />
<field name="controller_id" />
<field name="processor_ids" />
<separator />
<filter
string="Archived"
name="inactive"
domain="[('active', '=', False)]"
/>
<separator/>
<separator />
<group string="Group By" name="groupby">
<filter
name="controller_id_groupby"
@ -117,7 +113,6 @@
</search>
</field>
</record>
<record id="activity_action" model="ir.actions.act_window">
<field name="name">Activities</field>
<field name="res_model">privacy.activity</field>
@ -125,18 +120,17 @@
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to add a data processing activity.
</p><p>
</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