Skip to content

Commit

Permalink
[MIG] privacy_consent: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiToledo committed Feb 10, 2025
1 parent c24f0da commit 10720f2
Show file tree
Hide file tree
Showing 19 changed files with 247 additions and 243 deletions.
145 changes: 73 additions & 72 deletions privacy_consent/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ Privacy - Consent
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdata--protection-lightgray.png?logo=github
:target: https://github.com/OCA/data-protection/tree/16.0/privacy_consent
:target: https://github.com/OCA/data-protection/tree/17.0/privacy_consent
:alt: OCA/data-protection
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/data-protection-16-0/data-protection-16-0-privacy_consent
:target: https://translation.odoo-community.org/projects/data-protection-17-0/data-protection-17-0-privacy_consent
: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/data-protection&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/data-protection&target_branch=17.0
:alt: Try me on Runboat

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

This module allows the user to define a set of subjects (partners)
affected by any data processing activity, and establish
a process to ask them for consent to include them in that activity.
affected by any data processing activity, and establish a process to ask
them for consent to include them in that activity.

For those that need explicit consent as a lawfulness base for personal data
processing, as required by GDPR (article 6.1.a), this module provides the
needed tools to automate it.
For those that need explicit consent as a lawfulness base for personal
data processing, as required by GDPR (article 6.1.a), this module
provides the needed tools to automate it.

**Table of contents**

Expand All @@ -45,126 +45,127 @@ Installation
============

You may want to install, along with this module, one of OCA's
``mail_tracking`` module collection, such as ``mail_tracking_mailgun``, so
you can provide more undeniable proof that some consent request was sent, and
to whom.
``mail_tracking`` module collection, such as ``mail_tracking_mailgun``,
so you can provide more undeniable proof that some consent request was
sent, and to whom.

However, the most important proof to provide is the answer itself (more than
the question), and this addon provides enough tooling for that.
However, the most important proof to provide is the answer itself (more
than the question), and this addon provides enough tooling for that.

Multi-database instances
~~~~~~~~~~~~~~~~~~~~~~~~
------------------------

To enable multi-database support, you must load this addon as a server-wide
addon. Example command to boot Odoo::
To enable multi-database support, you must load this addon as a
server-wide addon. Example command to boot Odoo:

odoo-bin --load=web,privacy_consent
::

odoo-bin --load=web,privacy_consent

Usage
=====

New options for data processing activities:

#. Go to *Privacy > Master Data > Activities* and create one.

#. Give it a name, such as *Sending mass mailings to customers*.

#. Go to tab *Consent* and choose one option in *Ask subjects for consent*:
1. Go to *Privacy > Master Data > Activities* and create one.
2. Give it a name, such as *Sending mass mailings to customers*.
3. Go to tab *Consent* and choose one option in *Ask subjects for
consent*:

* *Manual* tells the activity that you will want to create and send the
consent requests manually, and only provides some helpers for you to
be able to batch-generate them.
- *Manual* tells the activity that you will want to create and send
the consent requests manually, and only provides some helpers for
you to be able to batch-generate them.
- *Automatic* enables this module's full power: send all consent
requests to selected partners automatically, every day and under
your demand.

* *Automatic* enables this module's full power: send all consent requests
to selected partners automatically, every day and under your demand.
4. When you do this, all the consent-related options appear. Configure
them:

#. When you do this, all the consent-related options appear. Configure them:
- A smart button tells you how many consents have been generated, and
lets you access them.

* A smart button tells you how many consents have been generated, and lets you
access them.
- Choose one *Email template* to send to subjects. This email itself
is what asks for consent, and it gets recorded, to serve as a proof
that it was sent. The module provides a default template that
should be good for most usage cases; and if you create one directly
from that field, some good defaults are provided for your
comfortability.

* Choose one *Email template* to send to subjects. This email itself is what
asks for consent, and it gets recorded, to serve as a proof that it was sent.
The module provides a default template that should be good for most usage
cases; and if you create one directly from that field, some good defaults
are provided for your comfortability.
- *Subjects filter* defines what partners will be elegible for
inclusion in this data processing activity.

* *Subjects filter* defines what partners will be elegible for inclusion in
this data processing activity.

* You can enable *Accepted by default* if you want to assume subjects
- You can enable *Accepted by default* if you want to assume subjects
accepted their data processing. You should possibly consult your
lawyer to use this.

* You can choose a *Server action* (developer mode only) that will
be executed whenever a new non-draft consent request is created,
or when its acceptance status changes.
- You can choose a *Server action* (developer mode only) that will be
executed whenever a new non-draft consent request is created, or
when its acceptance status changes.

This module supplies a server action by default, called
*Update partner's opt out*, that syncs the acceptance status with the
This module supplies a server action by default, called *Update
partner's opt out*, that syncs the acceptance status with the
partner's *Elegible for mass mailings* option.

#. Click on *Generate consent requests* link to create new consent requests.

* If you chose *Manual* mode, all missing consent request are created as
drafts, and nothing else is done now.
5. Click on *Generate consent requests* link to create new consent
requests.

* If you chose *Automatic* mode, also those request e-mails are enqueued
and, when the mail queue is cleared, they will be set as *Sent*.
- If you chose *Manual* mode, all missing consent request are created
as drafts, and nothing else is done now.
- If you chose *Automatic* mode, also those request e-mails are
enqueued and, when the mail queue is cleared, they will be set as
*Sent*.

#. You will be presented with the list of just-created consent requests.
6. You will be presented with the list of just-created consent requests.
See below.

New options for consent requests:

#. Access the consent requests by either:
1. Access the consent requests by either:

* Generating new consent requests from a data processing activity.
- Generating new consent requests from a data processing activity.
- Pressing the *Consents* smart button in a data processing activity.
- Going to *Privacy > Privacy > Consents*.

* Pressing the *Consents* smart button in a data processing activity.

* Going to *Privacy > Privacy > Consents*.

#. A consent will include the partner, the activity, the acceptance status,
and the request state.

#. You can manually ask for consent by pressing the button labeled as
2. A consent will include the partner, the activity, the acceptance
status, and the request state.
3. You can manually ask for consent by pressing the button labeled as
*Ask for consent*.

#. All consent requests and responses are recorded in the mail thread below.
4. All consent requests and responses are recorded in the mail thread
below.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/data-protection/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/data-protection/issues/new?body=module:%20privacy_consent%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/data-protection/issues/new?body=module:%20privacy_consent%0Aversion:%2017.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
* initOS GmbH

Contributors
~~~~~~~~~~~~
------------

* `Tecnativa <https://www.tecnativa.com>`_:
- `Tecnativa <https://www.tecnativa.com>`__:

* Jairo Llopis
- Jairo Llopis

* `initOS GmbH <https://www.initos.com>`_:
- `initOS GmbH <https://www.initos.com>`__:

* Florian Kantelberg
- Florian Kantelberg

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -176,6 +177,6 @@ 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.

This module is part of the `OCA/data-protection <https://github.com/OCA/data-protection/tree/16.0/privacy_consent>`_ project on GitHub.
This module is part of the `OCA/data-protection <https://github.com/OCA/data-protection/tree/17.0/privacy_consent>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion privacy_consent/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "Privacy - Consent",
"summary": "Allow people to explicitly accept or reject inclusion "
"in some activity, GDPR compliant",
"version": "16.0.1.0.1",
"version": "17.0.1.0.1",
"development_status": "Production/Stable",
"category": "Privacy",
"website": "https://github.com/OCA/data-protection",
Expand Down
2 changes: 1 addition & 1 deletion privacy_consent/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def consent(self, choice, consent_id, token, *args, **kwargs):
"controller_name_html": Markup(
consent.activity_id.controller_id.with_context(
show_address=True, html_format=True
).name_get()[0][1]
).display_name
),
},
)
Expand Down
2 changes: 1 addition & 1 deletion privacy_consent/models/mail_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MailTemplate(models.Model):
def _check_consent_links_in_body_html(self):
"""Body for ``privacy.consent`` templates needs placeholder links."""
links = [
"//a[@href='/privacy/consent/{}/']".format(action)
f"//a[@href='/privacy/consent/{action}/']"
for action in ("accept", "reject")
]
for one in self:
Expand Down
10 changes: 3 additions & 7 deletions privacy_consent/models/privacy_consent.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,19 @@ class PrivacyConsent(models.Model):
"related data processing activity.",
)
last_metadata = fields.Text(
readonly=True,
tracking=True,
help="Metadata from the last acceptance or rejection by the subject",
)
partner_id = fields.Many2one(
comodel_name="res.partner",
string="Subject",
required=True,
readonly=True,
tracking=True,
help="Subject asked for consent.",
)
activity_id = fields.Many2one(
comodel_name="privacy.activity",
string="Activity",
readonly=True,
required=True,
tracking=True,
)
Expand All @@ -57,7 +54,6 @@ class PrivacyConsent(models.Model):
("answered", "Answered"),
],
default="draft",
readonly=True,
required=True,
tracking=True,
)
Expand Down Expand Up @@ -117,9 +113,9 @@ def _run_action(self):
lambda x: x.state != "draft" and x.activity_id.server_action_id
):
action = one.activity_id.server_action_id.with_context(
active_id=one.id,
active_ids=one.ids,
active_model=one._name,
id=one.id,
ids=one.ids,
model=one._name,
)
action.run()

Expand Down
3 changes: 3 additions & 0 deletions privacy_consent/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions privacy_consent/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [Tecnativa](https://www.tecnativa.com):
- Jairo Llopis
- [initOS GmbH](https://www.initos.com):
- Florian Kantelberg
7 changes: 0 additions & 7 deletions privacy_consent/readme/CONTRIBUTORS.rst

This file was deleted.

7 changes: 7 additions & 0 deletions privacy_consent/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This module allows the user to define a set of subjects (partners)
affected by any data processing activity, and establish a process to ask
them for consent to include them in that activity.

For those that need explicit consent as a lawfulness base for personal
data processing, as required by GDPR (article 6.1.a), this module
provides the needed tools to automate it.
7 changes: 0 additions & 7 deletions privacy_consent/readme/DESCRIPTION.rst

This file was deleted.

14 changes: 14 additions & 0 deletions privacy_consent/readme/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
You may want to install, along with this module, one of OCA's
`mail_tracking` module collection, such as `mail_tracking_mailgun`, so
you can provide more undeniable proof that some consent request was
sent, and to whom.

However, the most important proof to provide is the answer itself (more
than the question), and this addon provides enough tooling for that.

## Multi-database instances

To enable multi-database support, you must load this addon as a
server-wide addon. Example command to boot Odoo:

odoo-bin --load=web,privacy_consent
15 changes: 0 additions & 15 deletions privacy_consent/readme/INSTALL.rst

This file was deleted.

Loading

0 comments on commit 10720f2

Please sign in to comment.