Browse Source

[IMP] add firstname and change label for lastname

9.0_remove_national_register_number
houssine 5 years ago
parent
commit
f3d696deda
  1. 4
      easy_my_coop/controllers/AuthSignupHome.py
  2. 15
      easy_my_coop/view/auth_signup_template.xml

4
easy_my_coop/controllers/AuthSignupHome.py

@ -15,7 +15,7 @@ from openerp.exceptions import ValidationError
_logger = logging.getLogger(__name__)
FORM_FIELDS = ['login', 'name', 'password', 'phone', 'street',
FORM_FIELDS = ['login', 'firstname', 'password', 'phone', 'street',
'city', 'zip_code', 'country_id']
@ -43,6 +43,8 @@ class AuthSignupHome(AuthSignupHome):
in lang_obj.sudo().search_read([], ['code'])]
if request.lang in supported_langs:
values['lang'] = request.lang
values['lastname'] = qcontext.get('name')
values['name'] = values.get('firstname') + ' ' + values.get('lastsname')
values['zip'] = values['zip_code']
uid = self._signup_with_values(qcontext.get('token'), values)
iban = qcontext.get('iban')

15
easy_my_coop/view/auth_signup_template.xml

@ -2,7 +2,20 @@
<odoo>
<data>
<template id="easy_my_coop_auth_fields" inherit_id="auth_signup.fields" name="Auth Signup/ResetPassword form fields">
<xpath expr="//div[@class='form-group field-name']" position="after">
<xpath expr="//input[@name='name']/.." position="before">
<div 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="John"
required="required" t-att-readonly="'readonly' if only_passwords else None" />
</div>
</xpath>
<xpath expr="//label[@for='name']" position="replace">
<label for="name" class="control-label">Your lastname</label>
</xpath>
<xpath expr="//input[@name='name']" position="attributes">
<attribute name="placeholder">Doe</attribute>
</xpath>
<xpath expr="//input[@name='name']/.." position="after">
<div 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"

Loading…
Cancel
Save