From c7a70415bd9ef9cb5d99adef113ee759ba875f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= <100228798+clementcharmillot@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:54:01 +0200 Subject: [PATCH] T1537 - my compassion data protection (#29) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add accept privacy data in profile * fix: add button spacing and translation --------- Co-authored-by: Clément --- my_compassion/controllers/my_account.py | 6 ++++- my_compassion/i18n/de.po | 5 ++++ my_compassion/i18n/fr_CH.po | 5 ++++ .../templates/my_account_personal_info.xml | 23 +++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/my_compassion/controllers/my_account.py b/my_compassion/controllers/my_account.py index 13b05df..98867ee 100644 --- a/my_compassion/controllers/my_account.py +++ b/my_compassion/controllers/my_account.py @@ -534,7 +534,7 @@ def my_donations(self, invoice_page=1, invoice_per_page=12, **kw): return request.render("my_compassion.my_donations_page_template", values) @route("/my/information", type="http", auth="user", website=True) - def my_information(self, form_id=None, **kw): + def my_information(self, form_id=None, privacy_policy=None, **kw): """ The route to display the information about the partner :param form_id: the form that has been filled or None @@ -548,6 +548,10 @@ def my_information(self, form_id=None, **kw): "partner": partner, } ) + + if privacy_policy == "accepted" and not partner.legal_agreement_date: + partner.legal_agreement_date = datetime.now() + return request.render("my_compassion.my_information_page_template", values) @route("/my/download/", type="http", auth="user", website=True) diff --git a/my_compassion/i18n/de.po b/my_compassion/i18n/de.po index 84d9610..8cf946f 100644 --- a/my_compassion/i18n/de.po +++ b/my_compassion/i18n/de.po @@ -17,6 +17,11 @@ msgstr "" msgid "(view agreement)" msgstr "(Vereinbarung anzeigen)" +#. module: my_compassion +#: model_terms:ir.ui.view,arch_db:my_compassion.my_information_privacy_data +msgid "Sign the Agreement" +msgstr "Unterschreiben" + #. module: my_compassion #: model_terms:ir.ui.view,arch_db:my_compassion.my_children_gift_history #: model_terms:ir.ui.view,arch_db:my_compassion.my_donations_gift_history diff --git a/my_compassion/i18n/fr_CH.po b/my_compassion/i18n/fr_CH.po index 6b97c09..ef08118 100644 --- a/my_compassion/i18n/fr_CH.po +++ b/my_compassion/i18n/fr_CH.po @@ -17,6 +17,11 @@ msgstr "" msgid "(view agreement)" msgstr "(voir le contrat)" +#. module: my_compassion +#: model_terms:ir.ui.view,arch_db:my_compassion.my_information_privacy_data +msgid "Sign the Agreement" +msgstr "Signer" + #. module: my_compassion #: model_terms:ir.ui.view,arch_db:my_compassion.my_children_gift_history #: model_terms:ir.ui.view,arch_db:my_compassion.my_donations_gift_history diff --git a/my_compassion/templates/my_account_personal_info.xml b/my_compassion/templates/my_account_personal_info.xml index e2a33ef..db5be09 100644 --- a/my_compassion/templates/my_account_personal_info.xml +++ b/my_compassion/templates/my_account_personal_info.xml @@ -141,6 +141,29 @@ /> (view agreement) +
+
+ + +
+ +