Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T1537 - my compassion data protection #29

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion my_compassion/controllers/my_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,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
Expand All @@ -547,6 +547,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/<source>", type="http", auth="user", website=True)
Expand Down
5 changes: 5 additions & 0 deletions my_compassion/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions my_compassion/i18n/fr_CH.po
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions my_compassion/templates/my_account_personal_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,29 @@
/>
<a href="/legal" target="_blank">(view agreement)</a>
</t>
<form t-else="" enctype="application/x-www-form-urlencoded">
<div class="form-check">
<input
type="checkbox"
value="accepted"
id="privacy_policy"
name="privacy_policy"
class="s_website_form_input form-check-input"
/>
<label
class="form-check-label font-weight-normal"
for="privacy_policy"
>
<t
t-call="website_legal_page.acceptance_full"
/>
</label>
</div>
<button
class="btn btn-primary w-100 mt-2"
type="submit"
>Sign the Agreement</button>
</form>
</div>
</div>
</template>
Expand Down
Loading