Browse Source

[ADD] require data policy approval

pull/2/head
robinkeunen 7 years ago
committed by Rémy Taymans
parent
commit
96f0b7f0d6
  1. 3
      easy_my_coop/controllers/main.py
  2. 6
      easy_my_coop/models/coop.py
  3. 1
      easy_my_coop/models/partner.py
  4. 20
      easy_my_coop/view/subscription_template.xml

3
easy_my_coop/controllers/main.py

@ -340,6 +340,9 @@ class WebsiteSubscription(http.Controller):
values["already_cooperator"] = already_coop
values["is_company"] = is_company
if kwargs.get('data_policy_approved', 'off') == 'on':
values['data_policy_approved'] = True
lastname = kwargs.get("lastname").upper()
firstname = kwargs.get("firstname").title()

6
easy_my_coop/models/coop.py

@ -16,6 +16,7 @@ _REQUIRED = ['email',
'city',
'iban',
'no_registre',
'data_policy_approved',
'gender'] # Could be improved including required from model
@ -329,6 +330,11 @@ class subscription_request(models.Model):
default="website",
readonly=True,
states={'draft': [('readonly', False)]})
data_policy_approved = fields.Boolean(
string='Data Policy Approved',
default=False,
# required=True,
)
_order = "id desc"
def get_person_info(self, partner):

1
easy_my_coop/models/partner.py

@ -139,6 +139,7 @@ class ResPartner(models.Model):
subscription_request_ids = fields.One2many('subscription.request',
'partner_id',
string="Subscription request")
data_policy_approved = fields.Boolean(string="Approved Data Policy")
@api.multi
@api.depends('subscription_request_ids.state')

20
easy_my_coop/view/subscription_template.xml

@ -240,6 +240,26 @@
<br/>
<div t-attf-class="form-group" >
<label class="col-md-3 col-sm-4 control-label" for="data_policy_approved">Privacy Policy</label>
<div class="col-md-7 col-sm-8">
<table>
<tr>
<td width='15%'>
<input type="checkbox"
class="form-control"
name="data_policy_approved"
required="True"
t-attf-value="#{data_policy_approved or ''}"/>
</td>
<td width='85%'>
La lucidité est la blessure la plus rapprochée du soleil.
</td>
</tr>
</table>
</div>
</div>
<table style="margin-left:195px">
<tr>
<td width="80%">

Loading…
Cancel
Save