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

[FIX] reset password erase partner information #33

Open
wants to merge 2 commits into
base: 11.0
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions dc_website_registration/controllers/authsignup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _signup_with_values(self, token, values):
raise SignupError(_('Authentication Failed.'))
return uid

def do_signup(self, qcontext):
def do_custom_signup(self, qcontext):
""" Shared helper that creates a res.partner out of a token """
values = dict((key, qcontext.get(key)) for key in ('login',
'name',
Expand Down Expand Up @@ -88,7 +88,7 @@ def web_auth_signup(self, *args, **kw):

if 'error' not in qcontext and request.httprequest.method == 'POST':
try:
self.do_signup(qcontext)
self.do_custom_signup(qcontext)
# Send an account creation confirmation email
if qcontext.get('token'):
user_sudo = request.env['res.users'].sudo().search([('login', '=', qcontext.get('login'))])
Expand Down
162 changes: 83 additions & 79 deletions dc_website_registration/views/auth_signup_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,96 @@
<data>
<template id="assets_frontend" inherit_id="web.assets_frontend" name="Distribution Circtuits Registration">
<xpath expr="." position="inside">
<script src="/dc_website_registration/static/src/js/auth_signup.js" type="text/javascript"/>
<script src="/dc_website_registration/static/src/js/auth_signup.js" type="text/javascript"/>
</xpath>
</template>

<template id="easy_my_hub_auth_fields" inherit_id="auth_signup.fields" name="Auth Signup/ResetPassword form fields">
<xpath expr="//input[@name='name']/.." position="replace"/>
<xpath expr="//input[@name='login']/.." position="after">
<div name="firstname" class="form-group field-name">
<label for="firstname" class="control-label">Your Firstname</label>
<input type="text" name="firstname" t-att-value="firstname" id="firstname" class="form-control" placeholder="e.g. John"
required="required" t-att-readonly="'readonly' if only_passwords else None"
t-att-autofocus="'autofocus' if login and not only_passwords else None" />
</div>
<div name="lastname" class="form-group field-name">
<label for="lastname" class="control-label">Your Lastname</label>
<input type="text" name="lastname" t-att-value="lastname" id="lastname" class="form-control" placeholder="e.g. Doe"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>
<div name="iban" class="form-group field-name">
<label for="iban" class="control-label">IBAN number</label>
<input type="text" name="iban" t-att-value="iban" id="iban" class="form-control" placeholder="BE645215965478"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>
<div name="phone" class="form-group field-name">
<label for="phone" class="control-label">Your Phone</label>
<input type="text" name="phone" t-att-value="phone" id="phone" class="form-control" placeholder="+325552365"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>

<div name="street" class="form-group field-name">
<label for="street" class="control-label">Your Street and Number</label>
<input type="text" name="street" t-att-value="street" id="street" class="form-control" placeholder="Rue de la transition, 63"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>

<div name="zip_code" class="form-group field-name">
<label for="zip_code" class="control-label">Your Zip Code</label>
<input type="text" name="zip_code" t-att-value="zip_code" id="zip_code" class="form-control" placeholder="1040"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>

<div name="city" class="form-group field-name">
<label for="city" class="control-label">Your City</label>
<input type="text" name="city" t-att-value="city" id="city" class="form-control" placeholder="Bruxelles"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>

<div name="country_id" class="form-group field-name">
<label for="country_id" class="control-label">Your Country</label>
<select name="country_id" id="country_id" class="form-control" style="width:54%;" required="required"
t-att-disabled="'disabled' if only_passwords else None" >
<option value="">Country...</option>
<t t-foreach="countries or []" t-as="country">
<option t-att-value="country.id" t-att-selected="country.id == int(country_id)"><t t-esc="country.name"/></option>
</t>
</select>
</div>
<div t-att-class="'hidden' if only_passwords else ''">
<div name="firstname" class="form-group field-name">
<label for="firstname" class="control-label">Your Firstname</label>
<input type="text" name="firstname" t-att-value="firstname" id="firstname" class="form-control" placeholder="e.g. John"
required="required" t-att-readonly="'readonly' if only_passwords else None"
t-att-autofocus="'autofocus' if login and not only_passwords else None" />
</div>
<div name="lastname" class="form-group field-name">
<label for="lastname" class="control-label">Your Lastname</label>
<input type="text" name="lastname" t-att-value="lastname" id="lastname" class="form-control" placeholder="e.g. Doe"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>
<div name="iban" class="form-group field-name">
<label for="iban" class="control-label">IBAN number</label>
<input type="text" name="iban" t-att-value="iban" id="iban" class="form-control" placeholder="BE645215965478"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>
<div name="phone" class="form-group field-name">
<label for="phone" class="control-label">Your Phone</label>
<input type="text" name="phone" t-att-value="phone" id="phone" class="form-control" placeholder="+325552365"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>

<div name="raliment_choice_guide" class="form-group field-name">
Choisissez :<br/>
- Soit de devenir membre d'un point de r'aliment, qui prépare les commandes (prix réduits),<br/>
- Soit de faire préparer vos commandes par <span t-field="res_company.name"/>, qui les livre dans un point de livraison<br/>
</div>
<div name="street" class="form-group field-name">
<label for="street" class="control-label">Your Street and Number</label>
<input type="text" name="street" t-att-value="street" id="street" class="form-control" placeholder="Rue de la transition, 63"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>

<div name="zip_code" class="form-group field-name">
<label for="zip_code" class="control-label">Your Zip Code</label>
<input type="text" name="zip_code" t-att-value="zip_code" id="zip_code" class="form-control" placeholder="1040"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>

<div name="city" class="form-group field-name">
<label for="city" class="control-label">Your City</label>
<input type="text" name="city" t-att-value="city" id="city" class="form-control" placeholder="Bruxelles"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>

<div name="country_id" class="form-group field-name">
<label for="country_id" class="control-label">Your Country</label>
<select name="country_id" id="country_id" class="form-control" style="width:54%;" required="required"
t-att-disabled="'disabled' if only_passwords else None" >
<option value="">Country...</option>
<t t-foreach="countries or []" t-as="country">
<option t-att-value="country.id" t-att-selected="country.id == int(country_id)"><t t-esc="country.name"/></option>
</t>
</select>
</div>

<div name="raliment_choice_guide" class="form-group field-name">
Choisissez :<br/>
- Soit de devenir membre d'un point de r'aliment, qui prépare les commandes (prix réduits),<br/>
- Soit de faire préparer vos commandes par <span t-field="res_company.name"/>, qui les livre dans un point de livraison<br/>
</div>

<div name="raliment_point" class="form-group field-name">
<label for="raliment_point_id" class="control-label">Your Raliment Point</label>
<select name="raliment_point_id" id="raliment_point_id" class="form-control"
t-att-disabled="'disabled' if only_passwords else None" >
<option value="">== Choose a Raliment Point ==</option>
<t t-foreach="raliment_points or []" t-as="raliment_point">
<option t-att-value="raliment_point.id" t-att-selected="raliment_point.id == int(raliment_point_id)"><t t-esc="raliment_point.name"/></option>
</t>
</select>
</div>

<div name="delivery_point" class="form-group field-name">
<label for="delivery_point_id" class="control-label">Your Delivery Point</label>
<select name="delivery_point_id" id="delivery_point_id" class="form-control"
t-att-disabled="'disabled' if only_passwords else None" >
<option value="">== Choose a Delivery Point ==</option>
<t t-foreach="delivery_points or []" t-as="delivery_point">
<option t-att-value="delivery_point.id" t-att-selected="delivery_point.id == int(delivery_point_id)"><t t-esc="delivery_point.name"/></option>
</t>
</select>
</div>
</div>
</xpath>

</template>

<div name="raliment_point" class="form-group field-name">
<label for="raliment_point_id" class="control-label">Your Raliment Point</label>
<select name="raliment_point_id" id="raliment_point_id" class="form-control"
t-att-disabled="'disabled' if only_passwords else None" >
<option value="">== Choose a Raliment Point ==</option>
<t t-foreach="raliment_points or []" t-as="raliment_point">
<option t-att-value="raliment_point.id" t-att-selected="raliment_point.id == int(raliment_point_id)"><t t-esc="raliment_point.name"/></option>
</t>
</select>
</div>

<div name="delivery_point" class="form-group field-name">
<label for="delivery_point_id" class="control-label">Your Delivery Point</label>
<select name="delivery_point_id" id="delivery_point_id" class="form-control"
t-att-disabled="'disabled' if only_passwords else None" >
<option value="">== Choose a Delivery Point ==</option>
<t t-foreach="delivery_points or []" t-as="delivery_point">
<option t-att-value="delivery_point.id" t-att-selected="delivery_point.id == int(delivery_point_id)"><t t-esc="delivery_point.name"/></option>
</t>
</select>
</div>
</xpath>
</template>
</data>
</odoo>