Browse Source

[IMP] add logged checkbox on the two subscription forms

pull/1/head
houssine 7 years ago
parent
commit
dde82cfbf1
  1. 2
      easy_my_coop/controllers/main.py
  2. 17
      easy_my_coop/view/subscription_template.xml

2
easy_my_coop/controllers/main.py

@ -54,10 +54,10 @@ class WebsiteSubscription(http.Controller):
def get_values_from_user(self, values, is_company): def get_values_from_user(self, values, is_company):
# the subscriber is connected # the subscriber is connected
if request.env.user.login != 'public': if request.env.user.login != 'public':
values['logged'] = 'on'
if is_company: if is_company:
print '' print ''
else: else:
values['logged'] = 'on'
partner = request.env.user.partner_id partner = request.env.user.partner_id
values['firstname'] = partner.firstname values['firstname'] = partner.firstname
values['lastname'] = partner.lastname values['lastname'] = partner.lastname

17
easy_my_coop/view/subscription_template.xml

@ -58,6 +58,13 @@
<p style="color:red;"><t t-esc="error_msg"/></p> <p style="color:red;"><t t-esc="error_msg"/></p>
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/> <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div t-attf-class="form-group" style="display: none;">
<label>
<input type="checkbox" t-att-checked="logged" name="logged"/>
Logged
</label>
</div>
<div t-attf-class="form-group"> <div t-attf-class="form-group">
<label> <label>
<input type="checkbox" t-att-value="already_cooperator" name="already_cooperator" /> <input type="checkbox" t-att-value="already_cooperator" name="already_cooperator" />
@ -116,8 +123,8 @@
<input type="text" class="form-control mandatory-field" name="iban" required="True" t-attf-value="#{iban or ''}" placeholder="BE48523080767127"/> <input type="text" class="form-control mandatory-field" name="iban" required="True" t-attf-value="#{iban or ''}" placeholder="BE48523080767127"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'lang' in error and 'has-error' or ''}" >
<div t-attf-class="form-group #{error and 'lang' in error and 'has-error' or ''}" >
<label class="col-md-3 col-sm-4 control-label" style="width:25%" for="lang">Language</label> <label class="col-md-3 col-sm-4 control-label" style="width:25%" for="lang">Language</label>
<select name="lang" class="col-md-7 col-sm-8 form-control " style="width:30%;margin-left:15px"> <select name="lang" class="col-md-7 col-sm-8 form-control " style="width:30%;margin-left:15px">
<option value="2">Language...</option> <option value="2">Language...</option>
@ -258,14 +265,18 @@
<p style="color:red;"><t t-esc="error_msg"/></p> <p style="color:red;"><t t-esc="error_msg"/></p>
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/> <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div t-attf-class="form-group" style="display: none;">
<div t-attf-class="form-group" style="display: none;">
<label>
<input type="checkbox" t-att-checked="logged" name="logged"/>
Logged
</label>
<label> <label>
<input type="checkbox" t-att-value="company" checked="checked" name="is_company" /> <input type="checkbox" t-att-value="company" checked="checked" name="is_company" />
Is a company? Is a company?
</label> </label>
</div> </div>
<div t-attf-class="form-group">
<div t-attf-class="form-group">
<label> <label>
Company Info Company Info
</label> </label>

Loading…
Cancel
Save