Browse Source

[IMP] set iban non required for this localisation

Remove iban number from the required fields and remove the field from
the web form
pull/4/head
houssine 6 years ago
parent
commit
18dce65cdc
  1. 5
      easy_my_coop_ch/models/coop.py
  2. 2
      easy_my_coop_ch/views/subscription_template.xml

5
easy_my_coop_ch/models/coop.py

@ -18,9 +18,14 @@ class subscription_request(models.Model):
req_fields = super(subscription_request, self).get_required_field() req_fields = super(subscription_request, self).get_required_field()
if 'no_registre' in req_fields: if 'no_registre' in req_fields:
req_fields.remove('no_registre') req_fields.remove('no_registre')
if 'iban' in req_fields:
req_fields.remove('iban')
return req_fields return req_fields
def check_belgian_identification_id(self, nat_register_num): def check_belgian_identification_id(self, nat_register_num):
# deactivate number validation for swiss localization # deactivate number validation for swiss localization
return True return True
def check_iban(self, iban):
return True

2
easy_my_coop_ch/views/subscription_template.xml

@ -3,10 +3,12 @@
<data> <data>
<template id="subscription_i18n_ch" inherit_id="easy_my_coop.becomecooperator" name="Removing fields"> <template id="subscription_i18n_ch" inherit_id="easy_my_coop.becomecooperator" name="Removing fields">
<xpath expr="//label[@for='no_registre']/.." position="replace"/> <xpath expr="//label[@for='no_registre']/.." position="replace"/>
<xpath expr="//label[@for='iban']/.." position="replace"/>
</template> </template>
<template id="company_subscription_i18n_ch" inherit_id="easy_my_coop.becomecompanycooperator" name="Company Removing fields"> <template id="company_subscription_i18n_ch" inherit_id="easy_my_coop.becomecompanycooperator" name="Company Removing fields">
<xpath expr="//label[@for='no_registre']/.." position="replace"/> <xpath expr="//label[@for='no_registre']/.." position="replace"/>
<xpath expr="//label[@for='iban']/.." position="replace"/>
</template> </template>
</data> </data>
</odoo> </odoo>
Loading…
Cancel
Save