Skip to content

Commit

Permalink
T1855 - Remove sponsor/child reference in signup page (#46)
Browse files Browse the repository at this point in the history
* removed code related to fetching existing partner based on sponsor/child refreference during signup

* clean

* pre-commit

* ruff

* removed unused translations
  • Loading branch information
Prazn authored Sep 26, 2024
1 parent db44673 commit 7343221
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 155 deletions.
1 change: 0 additions & 1 deletion my_compassion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
##############################################################################

from . import controllers, models
from .hooks import post_load
1 change: 0 additions & 1 deletion my_compassion/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,4 @@
"demo": [],
"installable": True,
"auto_install": False,
"post_load": "post_load",
}
47 changes: 0 additions & 47 deletions my_compassion/controllers/auth_signup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,12 @@
##############################################################################
from datetime import datetime

from odoo import _
from odoo.exceptions import UserError
from odoo.http import request

from odoo.addons.auth_signup.controllers.main import AuthSignupHome


class RegistrationController(AuthSignupHome):
def do_signup(self, qcontext):
"""
Check if a sponsor ref was given in order to try to match
an existing sponsor.
"""
sponsor_ref = qcontext.get("sponsor_ref")
if sponsor_ref:
sponsor = (
request.env["res.partner"]
.sudo()
.search([("ref", "=", sponsor_ref)], limit=1)
)
if not sponsor:
# Try to find based on a child reference, either global or local
child = (
request.env["compassion.child"]
.sudo()
.search(
[
("state", "=", "P"),
"|",
("global_id", "=", sponsor_ref),
("local_id", "=", sponsor_ref),
],
limit=1,
)
)
sponsor = child.sponsor_id
if sponsor:
if sponsor.email.lower() != qcontext["login"].lower():
raise UserError(
_(
"The email address you entered is not the same "
"as the one in the system. Please try again."
)
)
# Prepare token for signup
sponsor.signup_prepare()
qcontext["token"] = sponsor.signup_token
else:
raise UserError(
_("No sponsor found with this reference. Please try again.")
)
return super().do_signup(qcontext)

def _signup_with_values(self, token, values):
super()._signup_with_values(token, values)
request.env.user.partner_id.legal_agreement_date = datetime.now()
10 changes: 0 additions & 10 deletions my_compassion/hooks.py

This file was deleted.

29 changes: 0 additions & 29 deletions my_compassion/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -582,13 +582,6 @@ msgstr "Bezeichnung"
msgid "Need help?"
msgstr "Hilfe benötigt?"

#. module: my_compassion
#: code:addons/my_compassion/controllers/auth_signup.py:0
#, python-format
msgid "No sponsor found with this reference. Please try again."
msgstr ""
"Für diese Referenz wurde kein Sponsor gefunden. Bitte versuche es erneut."

#. module: my_compassion
#: code:addons/my_compassion/controllers/my_account.py:0
#, python-format
Expand Down Expand Up @@ -650,13 +643,6 @@ msgstr "Datenschutz"
msgid "Project activities"
msgstr "Aktivitäten im Kinderzentrum"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.signup_sponsor
msgid "Put any known reference here for matching with your account..."
msgstr ""
"Gib hier alle bekannten Referenzen ein, um sie mit deinem Konto "
"abzugleichen..."

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.letter_actions
msgid "Send"
Expand Down Expand Up @@ -733,16 +719,6 @@ msgstr "Vorlage Bild"
msgid "The address of Compassion Switzerland"
msgstr "Die Adresse von Compassion Schweiz"

#. module: my_compassion
#: code:addons/my_compassion/controllers/auth_signup.py:0
#, python-format
msgid ""
"The email address you entered is not the same as the one in the system. "
"Please try again."
msgstr ""
"Die E-Mail-Adresse, die du eingegeben hast, stimmt nicht mit der im System "
"überein. Bitte versuche es erneut."

#. module: my_compassion
#: model:ir.model.fields,help:my_compassion.field_correspondence_template__website_url
msgid "The full URL to access the document through the website."
Expand Down Expand Up @@ -929,11 +905,6 @@ msgstr "Deine Postadresse"
msgid "Your social media contact (Facebook or other platforms)"
msgstr "Deinen Facebook-Kontakt oder andere soziale Medien"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.signup_sponsor
msgid "Your sponsor or child reference"
msgstr "Dein Pate oder dein Kind - Referenznummer"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.my_donations_page_template
msgid "donation"
Expand Down
27 changes: 0 additions & 27 deletions my_compassion/i18n/fr_CH.po
Original file line number Diff line number Diff line change
Expand Up @@ -587,12 +587,6 @@ msgstr "Nom"
msgid "Need help?"
msgstr "Besoin d’aide ?"

#. module: my_compassion
#: code:addons/my_compassion/controllers/auth_signup.py:0
#, python-format
msgid "No sponsor found with this reference. Please try again."
msgstr "Aucun parrain n'a été trouvé pour cette référence. Veuillez réessayer."

#. module: my_compassion
#: code:addons/my_compassion/controllers/my_account.py:0
#, python-format
Expand Down Expand Up @@ -654,12 +648,6 @@ msgstr "Données de confidentialité"
msgid "Project activities"
msgstr "Activités au Centre"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.signup_sponsor
msgid "Put any known reference here for matching with your account..."
msgstr ""
"Mettez ici toute référence connue pour qu'elle corresponde à votre compte..."

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.letter_actions
msgid "Send"
Expand Down Expand Up @@ -736,16 +724,6 @@ msgstr "Modèle d'image"
msgid "The address of Compassion Switzerland"
msgstr "L'adresse de Compassion Suisse"

#. module: my_compassion
#: code:addons/my_compassion/controllers/auth_signup.py:0
#, python-format
msgid ""
"The email address you entered is not the same as the one in the system. "
"Please try again."
msgstr ""
"L'adresse électronique que vous avez saisie n'est pas la même que celle qui "
"figure dans le système. Veuillez réessayer."

#. module: my_compassion
#: model:ir.model.fields,help:my_compassion.field_correspondence_template__website_url
msgid "The full URL to access the document through the website."
Expand Down Expand Up @@ -935,11 +913,6 @@ msgstr "Votre adresse postale"
msgid "Your social media contact (Facebook or other platforms)"
msgstr "Votre profil Facebook ou d'autres médias sociaux"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.signup_sponsor
msgid "Your sponsor or child reference"
msgstr "Votre référence parrain ou enfant"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.my_donations_page_template
msgid "donation"
Expand Down
28 changes: 0 additions & 28 deletions my_compassion/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,6 @@ msgstr "Nome"
msgid "Need help?"
msgstr "Hai bisogno di aiuto?"

#. module: my_compassion
#: code:addons/my_compassion/controllers/auth_signup.py:0
#, python-format
msgid "No sponsor found with this reference. Please try again."
msgstr "Non è stato trovato alcuno sponsor per questo riferimento. Riprova."

#. module: my_compassion
#: code:addons/my_compassion/controllers/my_account.py:0
#, python-format
Expand Down Expand Up @@ -648,13 +642,6 @@ msgstr "Dati sulla privacy"
msgid "Project activities"
msgstr "Attività del progetto"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.signup_sponsor
msgid "Put any known reference here for matching with your account..."
msgstr ""
"Inserisci qui qualsiasi riferimento noto per confrontarlo con il tuo "
"account..."

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.letter_actions
msgid "Send"
Expand Down Expand Up @@ -731,16 +718,6 @@ msgstr "Immagine modello"
msgid "The address of Compassion Switzerland"
msgstr "L'indirizzo di Compassion Svizzera"

#. module: my_compassion
#: code:addons/my_compassion/controllers/auth_signup.py:0
#, python-format
msgid ""
"The email address you entered is not the same as the one in the system. "
"Please try again."
msgstr ""
"L'indirizzo e-mail inserito non corrisponde a quello presente nel sistema. "
"Riprova."

#. module: my_compassion
#: model:ir.model.fields,help:my_compassion.field_correspondence_template__website_url
msgid "The full URL to access the document through the website."
Expand Down Expand Up @@ -932,11 +909,6 @@ msgstr "Il tuo indirizzo postale"
msgid "Your social media contact (Facebook or other platforms)"
msgstr "Il tuo contatto sui social media (Facebook o altre piattaforme)"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.signup_sponsor
msgid "Your sponsor or child reference"
msgstr "Il tuo sponsor o bambino di riferimento"

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.my_donations_page_template
msgid "donation"
Expand Down
12 changes: 0 additions & 12 deletions my_compassion/templates/signup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@
<odoo>

<template id="signup_sponsor" inherit_id="auth_signup.fields">
<xpath expr="//div[@class='form-group field-name']" position="after">
<div class="form-group field-name">
<label for="sponsor_ref">Your sponsor or child reference</label>
<input
t-att-type="'hidden' if only_passwords else 'text'"
name="sponsor_ref"
id="sponsor_ref"
class="form-control form-control-sm"
placeholder="Put any known reference here for matching with your account..."
/>
</div>
</xpath>
<xpath
expr="//div[@class='form-group field-confirm_password']"
position="after"
Expand Down

0 comments on commit 7343221

Please sign in to comment.