Browse Source

Merge pull request #10 from coopiteasy/9.0-replace-nnis-by-email

9.0 replace nnis by email
pull/11/head
Houssine BAKKALI 5 years ago
committed by GitHub
parent
commit
1bce9250c4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      easy_my_coop/__openerp__.py
  2. 28
      easy_my_coop/controllers/main.py
  3. 48
      easy_my_coop/models/coop.py
  4. 8
      easy_my_coop/models/partner.py
  5. 6
      easy_my_coop/view/operation_request_view.xml
  6. 1
      easy_my_coop/view/subscription_request_view.xml
  7. 89
      easy_my_coop/view/subscription_template.xml
  8. 38
      easy_my_coop/wizard/create_subscription_from_partner.py
  9. 2
      easy_my_coop/wizard/create_subscription_from_partner.xml
  10. 10
      easy_my_coop/wizard/update_partner_info.py
  11. 1
      easy_my_coop/wizard/update_share_line.py
  12. 1
      easy_my_coop_ch/__openerp__.py
  13. 6
      easy_my_coop_ch/models/coop.py
  14. 13
      easy_my_coop_ch/views/subscription_request_view.xml
  15. 2
      easy_my_coop_ch/views/subscription_template.xml
  16. 6
      easy_my_coop_export_xlsx/wizard/export_global_wizard.py
  17. 5
      easy_my_coop_fr/models/coop.py
  18. 5
      easy_my_coop_fr/views/subscription_template.xml

24
easy_my_coop/__openerp__.py

@ -1,26 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013-2018 Open Architects Consulting SPRL.
# Copyright (C) 2018- Coop IT Easy SCRL.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2013-2018 Open Architects Consulting SPRL.
# © 2018 Coop IT Easy SCRLfs. (<http://www.coopiteasy.be>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
"name": "Easy My Coop", "name": "Easy My Coop",
"version": "9.0.1.3.1",
"version": "9.1.0.0.0",
"depends": ["base", "depends": ["base",
"sale", "sale",
"purchase", "purchase",

28
easy_my_coop/controllers/main.py

@ -14,14 +14,14 @@ _BLACKLIST = ['id', 'create_uid', 'create_date', 'write_uid', 'write_date',
'user_id', 'active'] 'user_id', 'active']
_COOP_FORM_FIELD = ['email', 'firstname', 'lastname', 'birthdate', 'iban', _COOP_FORM_FIELD = ['email', 'firstname', 'lastname', 'birthdate', 'iban',
'share_product_id', 'no_registre', 'address', 'city',
'share_product_id', 'address', 'city',
'zip_code', 'country_id', 'phone', 'lang', 'nb_parts', 'zip_code', 'country_id', 'phone', 'lang', 'nb_parts',
'total_parts', 'error_msg'] 'total_parts', 'error_msg']
_COMPANY_FORM_FIELD = ['is_company', 'company_register_number', 'company_name', _COMPANY_FORM_FIELD = ['is_company', 'company_register_number', 'company_name',
'company_email', 'company_type', 'email', 'firstname', 'company_email', 'company_type', 'email', 'firstname',
'lastname', 'birthdate', 'iban', 'share_product_id', 'lastname', 'birthdate', 'iban', 'share_product_id',
'no_registre', 'address', 'city', 'zip_code',
'address', 'city', 'zip_code',
'country_id', 'phone', 'lang', 'nb_parts', 'country_id', 'phone', 'lang', 'nb_parts',
'total_parts', 'error_msg'] 'total_parts', 'error_msg']
@ -63,7 +63,8 @@ class WebsiteSubscription(http.Controller):
if kwargs.get(field): if kwargs.get(field):
values[field] = kwargs.pop(field) values[field] = kwargs.pop(field)
values.update(kwargs=kwargs.items()) values.update(kwargs=kwargs.items())
return request.website.render("easy_my_coop.becomecompanycooperator", values)
return request.website.render("easy_my_coop.becomecompanycooperator",
values)
def preRenderThanks(self, values, kwargs): def preRenderThanks(self, values, kwargs):
""" Allow to be overrided """ """ Allow to be overrided """
@ -109,7 +110,6 @@ class WebsiteSubscription(http.Controller):
values['gender'] = representative.gender values['gender'] = representative.gender
values['email'] = representative.email values['email'] = representative.email
values['contact_person_function'] = representative.function values['contact_person_function'] = representative.function
values['no_registre'] = representative.national_register_number
values['birthdate'] = self.get_date_string(representative.birthdate) values['birthdate'] = self.get_date_string(representative.birthdate)
values['lang'] = representative.lang values['lang'] = representative.lang
values['phone'] = representative.phone values['phone'] = representative.phone
@ -118,7 +118,6 @@ class WebsiteSubscription(http.Controller):
values['lastname'] = partner.lastname values['lastname'] = partner.lastname
values['email'] = partner.email values['email'] = partner.email
values['gender'] = partner.gender values['gender'] = partner.gender
values['no_registre'] = partner.national_register_number
values['birthdate'] = self.get_date_string(partner.birthdate) values['birthdate'] = self.get_date_string(partner.birthdate)
values['lang'] = partner.lang values['lang'] = partner.lang
values['phone'] = partner.phone values['phone'] = partner.phone
@ -258,17 +257,6 @@ class WebsiteSubscription(http.Controller):
"is not valid") "is not valid")
return request.website.render(redirect, values) return request.website.render(redirect, values)
if not is_company and 'no_registre' in required_fields:
no_registre = re.sub('[^0-9a-zA-Z]+', '',
kwargs.get("no_registre"))
valid = sub_req_obj.check_belgian_identification_id(no_registre)
if not valid:
values = self.fill_values(values, is_company, logged)
values["error_msg"] = _("You national register number "
"is not valid")
return request.website.render(redirect, values)
values["no_registre"] = no_registre
# check the subscription's amount # check the subscription's amount
max_amount = company.subscription_maximum_amount max_amount = company.subscription_maximum_amount
if logged: if logged:
@ -314,7 +302,6 @@ class WebsiteSubscription(http.Controller):
def share_subscription(self, **kwargs): def share_subscription(self, **kwargs):
sub_req_obj = request.env['subscription.request'] sub_req_obj = request.env['subscription.request']
attach_obj = request.env['ir.attachment'] attach_obj = request.env['ir.attachment']
required_fields = sub_req_obj.sudo().get_required_field()
# List of file to add to ir_attachment once we have the ID # List of file to add to ir_attachment once we have the ID
post_file = [] post_file = []
@ -369,17 +356,12 @@ class WebsiteSubscription(http.Controller):
values["share_product_id"] = self.get_selected_share(kwargs).id values["share_product_id"] = self.get_selected_share(kwargs).id
if is_company: if is_company:
if kwargs.get("company_register_number", is_company):
if kwargs.get("company_register_number", False):
values["company_register_number"] = re.sub('[^0-9a-zA-Z]+', values["company_register_number"] = re.sub('[^0-9a-zA-Z]+',
'', '',
kwargs.get("company_register_number")) kwargs.get("company_register_number"))
subscription_id = sub_req_obj.sudo().create_comp_sub_req(values) subscription_id = sub_req_obj.sudo().create_comp_sub_req(values)
else: else:
if 'no_registre' in required_fields:
no_registre = re.sub('[^0-9a-zA-Z]+', '',
kwargs.get("no_registre"))
values["no_registre"] = no_registre
subscription_id = sub_req_obj.sudo().create(values) subscription_id = sub_req_obj.sudo().create(values)
if subscription_id: if subscription_id:

48
easy_my_coop/models/coop.py

@ -15,7 +15,6 @@ _REQUIRED = ['email',
'zip_code', 'zip_code',
'city', 'city',
'iban', 'iban',
'no_registre',
'gender'] # Could be improved including required from model 'gender'] # Could be improved including required from model
@ -43,12 +42,12 @@ class subscription_request(models.Model):
partner_obj = self.env['res.partner'] partner_obj = self.env['res.partner']
if not vals.get('partner_id'): if not vals.get('partner_id'):
cooperator = False cooperator = False
if vals.get('no_registre'):
cooperator = partner_obj.get_cooperator_from_nin(
vals.get('no_registre'))
if vals.get('email'):
cooperator = partner_obj.get_cooperator_from_email(
vals.get('email'))
if cooperator: if cooperator:
# TODO remove the following line of code once it has # TODO remove the following line of code once it has
# been founded a way to avoid dubble entry
# been found a way to avoid double entry
cooperator = cooperator[0] cooperator = cooperator[0]
if cooperator.member: if cooperator.member:
vals['type'] = 'increase' vals['type'] = 'increase'
@ -89,22 +88,6 @@ class subscription_request(models.Model):
return subscr_request return subscr_request
def check_belgian_identification_id(self, nat_register_num):
if not self.check_empty_string(nat_register_num):
return False
if len(nat_register_num) != 11:
return False
if not nat_register_num.isdigit():
return False
birthday_number = nat_register_num[0:9]
controle = nat_register_num[9:11]
check_controle = 97 - (int(birthday_number) % 97)
if int(check_controle) != int(controle):
check_controle = 97 - ((2000000000 + int(birthday_number)) % 97)
if int(check_controle) != int(controle):
return False
return True
def check_empty_string(self, value): def check_empty_string(self, value):
if value is None or value is False or value == '': if value is None or value is False or value == '':
return False return False
@ -119,17 +102,10 @@ class subscription_request(models.Model):
return validated return validated
@api.multi @api.multi
@api.depends('iban', 'no_registre', 'skip_control_ng', 'is_company')
@api.depends('iban', 'skip_control_ng', 'is_company')
def _validated_lines(self): def _validated_lines(self):
for sub_request in self: for sub_request in self:
validated = self.check_iban(sub_request.iban) validated = self.check_iban(sub_request.iban)
if validated and (sub_request.skip_control_ng or
self.check_belgian_identification_id(
sub_request.no_registre)):
validated = True
else:
validated = False
sub_request.validated = validated sub_request.validated = validated
@api.multi @api.multi
@ -234,9 +210,6 @@ class subscription_request(models.Model):
phone = fields.Char(string='Phone', phone = fields.Char(string='Phone',
readonly=True, readonly=True,
states={'draft': [('readonly', False)]}) states={'draft': [('readonly', False)]})
no_registre = fields.Char(string='National Register Number',
readonly=True,
states={'draft': [('readonly', False)]})
user_id = fields.Many2one('res.users', user_id = fields.Many2one('res.users',
string='Responsible', string='Responsible',
readonly=True) readonly=True)
@ -349,7 +322,6 @@ class subscription_request(models.Model):
self.firstname = partner.firstname self.firstname = partner.firstname
self.name = partner.name self.name = partner.name
self.lastname = partner.lastname self.lastname = partner.lastname
self.no_registre = partner.national_register_number
self.email = partner.email self.email = partner.email
self.birthdate = partner.birthdate_date self.birthdate = partner.birthdate_date
self.gender = partner.gender self.gender = partner.gender
@ -469,7 +441,6 @@ class subscription_request(models.Model):
'zip': self.zip_code, 'email': self.email, 'zip': self.zip_code, 'email': self.email,
'gender': self.gender, 'cooperator': True, 'gender': self.gender, 'cooperator': True,
'city': self.city, 'phone': self.phone, 'city': self.city, 'phone': self.phone,
'national_register_number': self.no_registre,
'out_inv_comm_type': 'bba', 'out_inv_comm_type': 'bba',
'out_inv_comm_algorithm': 'random', 'out_inv_comm_algorithm': 'random',
'country_id': self.country_id.id, 'lang': self.lang, 'country_id': self.country_id.id, 'lang': self.lang,
@ -513,8 +484,8 @@ class subscription_request(models.Model):
' checked please select a cooperator.')) ' checked please select a cooperator.'))
elif self.is_company and self.company_register_number: elif self.is_company and self.company_register_number:
domain = [('company_register_number', '=', self.company_register_number)] #noqa domain = [('company_register_number', '=', self.company_register_number)] #noqa
elif not self.is_company and self.no_registre:
domain = [('national_register_number', '=', self.no_registre)]
elif not self.is_company and self.email:
domain = [('email', '=', self.email)]
if domain: if domain:
partner = partner_obj.search(domain) partner = partner_obj.search(domain)
@ -526,8 +497,8 @@ class subscription_request(models.Model):
if self.is_company and not partner.has_representative(): if self.is_company and not partner.has_representative():
contact = False contact = False
if self.no_registre:
domain = [('national_register_number', '=', self.no_registre)]
if self.email:
domain = [('email', '=', self.email)]
contact = partner_obj.search(domain) contact = partner_obj.search(domain)
if contact: if contact:
contact.type = 'representative' contact.type = 'representative'
@ -539,7 +510,6 @@ class subscription_request(models.Model):
'street': self.address, 'gender': self.gender, 'street': self.address, 'gender': self.gender,
'zip': self.zip_code, 'city': self.city, 'zip': self.zip_code, 'city': self.city,
'phone': self.phone, 'email': self.email, 'phone': self.phone, 'email': self.email,
'national_register_number': self.no_registre,
'country_id': self.country_id.id, 'country_id': self.country_id.id,
'out_inv_comm_type': 'bba', 'out_inv_comm_type': 'bba',
'out_inv_comm_algorithm': 'random', 'out_inv_comm_algorithm': 'random',

8
easy_my_coop/models/partner.py

@ -167,10 +167,10 @@ class ResPartner(models.Model):
def get_representative(self): def get_representative(self):
return self.child_ids.filtered('representative') return self.child_ids.filtered('representative')
def get_cooperator_from_nin(self, national_id_number):
def get_cooperator_from_email(self, email):
return self.search([('cooperator', '=', True), return self.search([('cooperator', '=', True),
('national_register_number', '=', national_id_number)])
('email', '=', email)])
def get_cooperator_from_crn(self, company_register_number):
def get_cooperator_from_crn(self, comp_reg_number):
return self.search([('cooperator', '=', True), return self.search([('cooperator', '=', True),
('company_register_number', '=', company_register_number)])
('company_register_number', '=', comp_reg_number)])

6
easy_my_coop/view/operation_request_view.xml

@ -53,10 +53,9 @@
<field name="subscription_request" attrs="{'invisible':['|',('operation_type','!=','transfer'),('receiver_not_member','=',False)]}" context="{'default_is_operation': True, 'default_ordered_parts':quantity,'default_share_product_id': share_product_id, 'default_source':'operation'}"> <field name="subscription_request" attrs="{'invisible':['|',('operation_type','!=','transfer'),('receiver_not_member','=',False)]}" context="{'default_is_operation': True, 'default_ordered_parts':quantity,'default_share_product_id': share_product_id, 'default_source':'operation'}">
<tree> <tree>
<field name="name"/> <field name="name"/>
<field name="no_registre"/>
<field name="email"/>
<field name="birthdate"/> <field name="birthdate"/>
<field name="phone"/> <field name="phone"/>
<field name="email"/>
<field name="iban"/> <field name="iban"/>
<field name="state" invisible="True"/> <field name="state" invisible="True"/>
</tree> </tree>
@ -67,11 +66,10 @@
<field name="name"/> <field name="name"/>
<field name="firstname"/> <field name="firstname"/>
<field name="lastname"/> <field name="lastname"/>
<field name="email"/>
<field name="birthdate"/> <field name="birthdate"/>
<field name="gender"/> <field name="gender"/>
<field name="email"/>
<field name="phone"/> <field name="phone"/>
<field name="no_registre"/>
<field name="iban"/> <field name="iban"/>
</group> </group>
<group> <group>

1
easy_my_coop/view/subscription_request_view.xml

@ -58,7 +58,6 @@
<field name="email"/> <field name="email"/>
<field name="phone"/> <field name="phone"/>
<field name="contact_person_function" attrs="{'invisible':[('is_company','=',False)]}"/> <field name="contact_person_function" attrs="{'invisible':[('is_company','=',False)]}"/>
<field name="no_registre"/>
<field name="iban"/> <field name="iban"/>
<field name="address"/> <field name="address"/>
<field name="zip_code"/> <field name="zip_code"/>

89
easy_my_coop/view/subscription_template.xml

@ -80,27 +80,34 @@
<div name="email_from_container" t-attf-class="form-group #{error and 'email_from' in error and 'has-error' or ''}"> <div name="email_from_container" t-attf-class="form-group #{error and 'email_from' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="email">Email</label> <label class="col-md-3 col-sm-4 control-label" for="email">Email</label>
<div class="col-md-7 col-sm-8 bottom-line" style="padding-bottom:20px"> <div class="col-md-7 col-sm-8 bottom-line" style="padding-bottom:20px">
<input type="email" class="form-control mandatory-field" name="email" required="True" t-attf-value="#{email or ''}" placeholder="didier.bourdon@bees-coop.be"/>
<input type="email" class="form-control mandatory-field" name="email"
required="required" t-att-readonly="logged"
t-attf-value="#{email or ''}" placeholder="didier.bourdon@bees-coop.be"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'firstname' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'firstname' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="name">First Name</label> <label class="col-md-3 col-sm-4 control-label" for="name">First Name</label>
<div class="col-md-7 col-sm-8" style="padding-top:5px"> <div class="col-md-7 col-sm-8" style="padding-top:5px">
<input type="text" class="form-control mandatory-field" name="firstname" required="True" t-attf-value="#{firstname or ''}" placeholder="Didier"/>
<input type="text" class="form-control mandatory-field" name="firstname"
required="required" t-att-readonly="logged"
t-attf-value="#{firstname or ''}" placeholder="Didier"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'lastname' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'lastname' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="name">Last Name</label> <label class="col-md-3 col-sm-4 control-label" for="name">Last Name</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="lastname" required="True" t-attf-value="#{lastname or ''}" placeholder="Bourdon"/>
<input type="text" class="form-control mandatory-field" name="lastname"
required="required" t-att-readonly="logged"
t-attf-value="#{lastname or ''}" placeholder="Bourdon"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'gender' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'gender' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="company_type">Gender</label> <label class="col-md-3 col-sm-4 control-label" for="company_type">Gender</label>
<select name="gender" class="col-md-7 col-sm-8 form-control" required="True" style="width:54%;margin-left:15px">
<select name="gender" class="col-md-7 col-sm-8 form-control" required="required"
t-att-readonly="logged" style="width:54%;margin-left:15px">
<option value=""></option> <option value=""></option>
<t t-foreach="genders or []" t-as="type"> <t t-foreach="genders or []" t-as="type">
<option t-att-value="type[0]" t-att-selected="type[0] == gender"><t t-esc="type[1]"/></option> <option t-att-value="type[0]" t-att-selected="type[0] == gender"><t t-esc="type[1]"/></option>
@ -111,27 +118,25 @@
<div t-attf-class="form-group #{error and 'birthdate' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'birthdate' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="birthdate">Birthdate</label> <label class="col-md-3 col-sm-4 control-label" for="birthdate">Birthdate</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-8">
<input type="text" data-inputmask="'alias': 'date'" class="form-control mandatory-field" name="birthdate" required="True" t-attf-value="#{birthdate or ''}" placeholder="05/03/1978"/>
</div>
</div>
<div t-attf-class="form-group #{error and 'no_registre' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="no_registre">National Register Number</label>
<div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="no_registre" t-attf-value="#{no_registre or ''}" placeholder="78230226321"/>
<input type="text" data-inputmask="'alias': 'date'" class="form-control mandatory-field"
name="birthdate" required="required" t-att-readonly="logged"
t-attf-value="#{birthdate or ''}" placeholder="05/03/1978"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="iban">Bank Account Number</label> <label class="col-md-3 col-sm-4 control-label" for="iban">Bank Account Number</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-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="required" t-att-readonly="logged"
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" t-att-readonly="logged"
style="width:30%;margin-left:15px">
<option value="2">Language...</option> <option value="2">Language...</option>
<t t-foreach="langs or []" t-as="langue"> <t t-foreach="langs or []" t-as="langue">
<option t-att-value="langue.code" t-att-selected="langue.code == lang"><t t-esc="langue.name"/></option> <option t-att-value="langue.code" t-att-selected="langue.code == lang"><t t-esc="langue.name"/></option>
@ -144,7 +149,9 @@
<div t-attf-class="form-group #{error and 'address' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'address' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="address">Address</label> <label class="col-md-3 col-sm-4 control-label" for="address">Address</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="address" required="True" t-attf-value="#{address or ''}" placeholder="rue Van Hove, 19"/>
<input type="text" class="form-control mandatory-field" name="address"
required="required" t-att-readonly="logged"
t-attf-value="#{address or ''}" placeholder="rue Van Hove, 19"/>
</div> </div>
</div> </div>
@ -154,11 +161,15 @@
<table> <table>
<tr> <tr>
<td width="20%"> <td width="20%">
<input type="text" class="form-control mandatory-field" name="zip_code" required="True" t-attf-value="#{zip_code or ''}" placeholder="1030"/>
<input type="text" class="form-control mandatory-field" name="zip_code"
required="required" t-att-readonly="logged"
t-attf-value="#{zip_code or ''}" placeholder="1030"/>
</td> </td>
<td width="3%"></td> <td width="3%"></td>
<td> <td>
<input type="text" class="form-control mandatory-field" name="city" required="True" t-attf-value="#{city or ''}" placeholder="Bruxelles"/>
<input type="text" class="form-control mandatory-field" name="city"
required="required" t-att-readonly="logged"
t-attf-value="#{city or ''}" placeholder="Bruxelles"/>
</td> </td>
</tr> </tr>
</table> </table>
@ -167,7 +178,8 @@
<div t-attf-class="form-group #{error and 'country_id' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'country_id' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" style="width:25%" for="country_id">Country</label> <label class="col-md-3 col-sm-4 control-label" style="width:25%" for="country_id">Country</label>
<select name="country_id" class="col-md-7 col-sm-8 form-control " style="width:54%;margin-left:15px">
<select name="country_id" class="col-md-7 col-sm-8 form-control " t-att-readonly="logged"
style="width:54%;margin-left:15px">
<option value="">Country...</option> <option value="">Country...</option>
<t t-foreach="countries or []" t-as="country"> <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> <option t-att-value="country.id" t-att-selected="country.id == int(country_id)"><t t-esc="country.name"/></option>
@ -178,7 +190,9 @@
<div t-attf-class="form-group #{error and 'phone' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'phone' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="phone">Phone</label> <label class="col-md-3 col-sm-4 control-label" for="phone">Phone</label>
<div class="col-md-7 col-sm-8 bottom-line" style="padding-bottom:20px"> <div class="col-md-7 col-sm-8 bottom-line" style="padding-bottom:20px">
<input type="text" class="form-control" name="phone" required="True" t-attf-value="#{phone or ''}" placeholder="e.g. (+32).81.81.37.00"/>
<input type="text" class="form-control" name="phone"
required="required" t-att-readonly="logged"
t-attf-value="#{phone or ''}" placeholder="e.g. (+32).81.81.37.00"/>
</div> </div>
</div> </div>
@ -333,20 +347,20 @@
<div t-attf-class="form-group #{error and 'company_register_number' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'company_register_number' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="company_register_number">Company Register Number</label> <label class="col-md-3 col-sm-4 control-label" for="company_register_number">Company Register Number</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="company_register_number" required="True" t-attf-value="#{company_register_number or ''}" placeholder="0647980091"/>
<input type="text" class="form-control mandatory-field" name="company_register_number" required="required" t-attf-value="#{company_register_number or ''}" placeholder="0647980091"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'company_name' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'company_name' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="company_name">Company name</label> <label class="col-md-3 col-sm-4 control-label" for="company_name">Company name</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="company_name" required="True" t-attf-value="#{company_name or ''}" placeholder="La super coopérative"/>
<input type="text" class="form-control mandatory-field" name="company_name" required="required" t-attf-value="#{company_name or ''}" placeholder="La super coopérative"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'company_type' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'company_type' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="company_type">Company type</label> <label class="col-md-3 col-sm-4 control-label" for="company_type">Company type</label>
<select name="company_type" class="col-md-7 col-sm-8 form-control" required="True" style="width:54%;margin-left:15px">
<select name="company_type" class="col-md-7 col-sm-8 form-control" required="required" style="width:54%;margin-left:15px">
<option value=""></option> <option value=""></option>
<t t-foreach="company_types or []" t-as="type"> <t t-foreach="company_types or []" t-as="type">
<option t-att-value="type[0]" t-att-selected="type[0] == company_type"><t t-esc="type[1]"/></option> <option t-att-value="type[0]" t-att-selected="type[0] == company_type"><t t-esc="type[1]"/></option>
@ -357,14 +371,14 @@
<div t-attf-class="form-group #{error and 'company_email' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'company_email' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="company_email">Company email</label> <label class="col-md-3 col-sm-4 control-label" for="company_email">Company email</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="company_email" required="True" t-attf-value="#{company_email or ''}" placeholder="administration@beescoop.be"/>
<input type="text" class="form-control mandatory-field" name="company_email" required="required" t-attf-value="#{company_email or ''}" placeholder="administration@beescoop.be"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="iban">Bank Account Number</label> <label class="col-md-3 col-sm-4 control-label" for="iban">Bank Account Number</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-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="required" t-attf-value="#{iban or ''}" placeholder="BE48523080767127"/>
</div> </div>
</div> </div>
@ -378,7 +392,7 @@
<div t-attf-class="form-group #{error and 'address' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'address' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="address">Address</label> <label class="col-md-3 col-sm-4 control-label" for="address">Address</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="address" required="True" t-attf-value="#{address or ''}" placeholder="rue Van Hove, 19"/>
<input type="text" class="form-control mandatory-field" name="address" required="required" t-attf-value="#{address or ''}" placeholder="rue Van Hove, 19"/>
</div> </div>
</div> </div>
@ -388,11 +402,11 @@
<table> <table>
<tr> <tr>
<td width="20%"> <td width="20%">
<input type="text" class="form-control mandatory-field" name="zip_code" required="True" t-attf-value="#{zip_code or ''}" placeholder="1030"/>
<input type="text" class="form-control mandatory-field" name="zip_code" required="required" t-attf-value="#{zip_code or ''}" placeholder="1030"/>
</td> </td>
<td width="3%"></td> <td width="3%"></td>
<td> <td>
<input type="text" class="form-control mandatory-field" name="city" required="True" t-attf-value="#{city or ''}" placeholder="Bruxelles"/>
<input type="text" class="form-control mandatory-field" name="city" required="required" t-attf-value="#{city or ''}" placeholder="Bruxelles"/>
</td> </td>
</tr> </tr>
</table> </table>
@ -419,20 +433,20 @@
<div t-attf-class="form-group #{error and 'firstname' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'firstname' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="firstname">First Name</label> <label class="col-md-3 col-sm-4 control-label" for="firstname">First Name</label>
<div class="col-md-7 col-sm-8" style="padding-top:5px"> <div class="col-md-7 col-sm-8" style="padding-top:5px">
<input type="text" class="form-control mandatory-field" name="firstname" required="True" t-attf-value="#{firstname or ''}" placeholder="Didier"/>
<input type="text" class="form-control mandatory-field" name="firstname" required="required" t-attf-value="#{firstname or ''}" placeholder="Didier"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'lastname' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'lastname' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="lastname">Last Name</label> <label class="col-md-3 col-sm-4 control-label" for="lastname">Last Name</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="lastname" required="True" t-attf-value="#{lastname or ''}" placeholder="Bourdon"/>
<input type="text" class="form-control mandatory-field" name="lastname" required="required" t-attf-value="#{lastname or ''}" placeholder="Bourdon"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'gender' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'gender' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="gender">Gender</label> <label class="col-md-3 col-sm-4 control-label" for="gender">Gender</label>
<select name="gender" class="col-md-7 col-sm-8 form-control" required="True" style="width:54%;margin-left:15px">
<select name="gender" class="col-md-7 col-sm-8 form-control" required="required" style="width:54%;margin-left:15px">
<option value=""></option> <option value=""></option>
<t t-foreach="genders or []" t-as="type"> <t t-foreach="genders or []" t-as="type">
<option t-att-value="type[0]" t-att-selected="type[0] == gender"><t t-esc="type[1]"/></option> <option t-att-value="type[0]" t-att-selected="type[0] == gender"><t t-esc="type[1]"/></option>
@ -443,35 +457,28 @@
<div name="email_from_container" t-attf-class="form-group #{error and 'email_from' in error and 'has-error' or ''}"> <div name="email_from_container" t-attf-class="form-group #{error and 'email_from' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="email">Email</label> <label class="col-md-3 col-sm-4 control-label" for="email">Email</label>
<div class="col-md-7 col-sm-8 bottom-line" style="padding-bottom:20px"> <div class="col-md-7 col-sm-8 bottom-line" style="padding-bottom:20px">
<input type="email" class="form-control mandatory-field" name="email" required="True" t-attf-value="#{email or ''}" placeholder="didier.bourdon@bees-coop.be"/>
<input type="email" class="form-control mandatory-field" name="email" required="required" t-attf-value="#{email or ''}" placeholder="didier.bourdon@bees-coop.be"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'phone' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'phone' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="phone">Phone</label> <label class="col-md-3 col-sm-4 control-label" for="phone">Phone</label>
<div class="col-md-7 col-sm-8 bottom-line" style="padding-bottom:20px"> <div class="col-md-7 col-sm-8 bottom-line" style="padding-bottom:20px">
<input type="text" class="form-control" name="phone" required="True" t-attf-value="#{phone or ''}" placeholder="e.g. (+32).81.81.37.00"/>
<input type="text" class="form-control" name="phone" required="required" t-attf-value="#{phone or ''}" placeholder="e.g. (+32).81.81.37.00"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'contact_person_function' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'contact_person_function' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="contact_person_function">Function</label> <label class="col-md-3 col-sm-4 control-label" for="contact_person_function">Function</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="contact_person_function" required="True" t-attf-value="#{contact_person_function or ''}"/>
</div>
</div>
<div t-attf-class="form-group #{error and 'no_registre' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="no_registre">National Register Number</label>
<div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="no_registre" required="True" t-attf-value="#{no_registre or ''}" placeholder="78230226321"/>
<input type="text" class="form-control mandatory-field" name="contact_person_function" required="required" t-attf-value="#{contact_person_function or ''}"/>
</div> </div>
</div> </div>
<div t-attf-class="form-group #{error and 'birthday' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'birthday' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="birthdate">Birthdate</label> <label class="col-md-3 col-sm-4 control-label" for="birthdate">Birthdate</label>
<div class="col-md-7 col-sm-8"> <div class="col-md-7 col-sm-8">
<input type="text" data-inputmask="'alias': 'date'" class="form-control mandatory-field" name="birthdate" required="True" t-attf-value="#{birthdate or ''}" placeholder="05/03/1978"/>
<input type="text" data-inputmask="'alias': 'date'" class="form-control mandatory-field" name="birthdate" required="required" t-attf-value="#{birthdate or ''}" placeholder="05/03/1978"/>
</div> </div>
</div> </div>

38
easy_my_coop/wizard/create_subscription_from_partner.py

@ -30,15 +30,15 @@ class PartnerCreateSubscription(models.TransientModel):
def _get_representative(self): def _get_representative(self):
partner = self._get_partner() partner = self._get_partner()
if partner.is_company: if partner.is_company:
return self.env['res.partner'].search([('parent_id', '=', partner.id),
return partner.search([('parent_id', '=', partner.id),
('representative', '=', True)]) ('representative', '=', True)])
return False return False
@api.model @api.model
def _get_representative_number(self):
def _get_representative_email(self):
representative = self._get_representative() representative = self._get_representative()
if representative: if representative:
return representative.national_register_number
return representative.email
return False return False
@api.model @api.model
@ -67,8 +67,6 @@ class PartnerCreateSubscription(models.TransientModel):
partner = self._get_partner() partner = self._get_partner()
if partner.is_company: if partner.is_company:
return partner.company_register_number return partner.company_register_number
else:
return partner.national_register_number
@api.model @api.model
def _get_bank_account(self): def _get_bank_account(self):
@ -101,8 +99,7 @@ class PartnerCreateSubscription(models.TransientModel):
cooperator = fields.Many2one('res.partner', cooperator = fields.Many2one('res.partner',
string="Cooperator", string="Cooperator",
default=_get_partner) default=_get_partner)
register_number = fields.Char(string="Register Number",
required=True,
register_number = fields.Char(string="Register Company Number",
default=_get_register_number) default=_get_register_number)
email = fields.Char(string="Email", email = fields.Char(string="Email",
required=True, required=True,
@ -126,16 +123,8 @@ class PartnerCreateSubscription(models.TransientModel):
readonly=True) readonly=True)
representative_name = fields.Char(string='Representative name', representative_name = fields.Char(string='Representative name',
default=_get_representative_name) default=_get_representative_name)
representative_number = fields.Char(string='Representative national '
'register number',
default=_get_representative_number)
def check_belgian_ident_id(self, register_number):
sub_req = self.env['subscription.request']
if sub_req.check_belgian_identification_id(register_number):
return True
else:
raise UserError(_("The national register number is not valid."))
representative_email = fields.Char(string='Representative email',
default=_get_representative_email)
@api.multi @api.multi
def create_subscription(self): def create_subscription(self):
@ -163,7 +152,6 @@ class PartnerCreateSubscription(models.TransientModel):
vals['is_company'] = True vals['is_company'] = True
else: else:
vals['name'] = cooperator.name vals['name'] = cooperator.name
vals['no_registre'] = self.register_number
coop_vals = {} coop_vals = {}
if not self._get_email(): if not self._get_email():
@ -172,15 +160,12 @@ class PartnerCreateSubscription(models.TransientModel):
if not self._get_register_number(): if not self._get_register_number():
if self.is_company: if self.is_company:
coop_vals['company_register_number'] = self.register_number coop_vals['company_register_number'] = self.register_number
else:
if self.check_belgian_ident_id(self.register_number):
coop_vals['national_register_number'] = self.register_number
if self.is_company and not self._get_representative(): if self.is_company and not self._get_representative():
representative = False representative = False
if self.representative_number:
representative_number = self.representative_number
representative = partner_obj.search([('national_register_number', '=', representative_number)])
if self.representative_email:
representative = partner_obj.search(
[('email', '=', self.representative_email)])
if representative: if representative:
if len(representative) > 1: if len(representative) > 1:
@ -193,10 +178,10 @@ class PartnerCreateSubscription(models.TransientModel):
"two different companies.")) "two different companies."))
representative.parent_id = cooperator.id representative.parent_id = cooperator.id
else: else:
if self.check_belgian_ident_id(representative_number):
if self.representative_email:
represent_vals = {'name': self.representative_name, represent_vals = {'name': self.representative_name,
'cooperator': True, 'cooperator': True,
'national_register_number': representative_number,
'email': self.representative_email,
'parent_id': cooperator.id, 'parent_id': cooperator.id,
'representative': True} 'representative': True}
partner_obj.create(represent_vals) partner_obj.create(represent_vals)
@ -209,7 +194,6 @@ class PartnerCreateSubscription(models.TransientModel):
if self.is_company: if self.is_company:
representative = self._get_representative() representative = self._get_representative()
vals['name'] = representative.name vals['name'] = representative.name
vals['no_registre'] = representative.national_register_number
if coop_vals: if coop_vals:
cooperator.write(coop_vals) cooperator.write(coop_vals)

2
easy_my_coop/wizard/create_subscription_from_partner.xml

@ -13,7 +13,7 @@
<field name="is_company" invisible="True"/> <field name="is_company" invisible="True"/>
<field name="cooperator" invisible="True"/> <field name="cooperator" invisible="True"/>
<field name="representative_name" attrs="{'invisible':[('is_company','=',False)],'required':[('is_company','=',True)]}"/> <field name="representative_name" attrs="{'invisible':[('is_company','=',False)],'required':[('is_company','=',True)]}"/>
<field name="representative_number" attrs="{'invisible':[('is_company','=',False)],'required':[('is_company','=',True)]}"/>
<field name="representative_email" attrs="{'invisible':[('is_company','=',False)],'required':[('is_company','=',True)]}"/>
<field name="email"/> <field name="email"/>
<field name="register_number"/> <field name="register_number"/>
<field name="bank_account"/> <field name="bank_account"/>

10
easy_my_coop/wizard/update_partner_info.py

@ -28,13 +28,6 @@ class PartnerUpdateInfo(models.TransientModel):
string="Cooperator", string="Cooperator",
default=_get_partner) default=_get_partner)
def check_belgian_ident_id(self, register_number):
if self.env['subscription.request'].check_belgian_identification_id(
register_number):
return True
else:
raise UserError(_("The national register number is not valid."))
@api.multi @api.multi
def update(self): def update(self):
@ -43,9 +36,6 @@ class PartnerUpdateInfo(models.TransientModel):
if cooperator.is_company: if cooperator.is_company:
coop_vals['company_register_number'] = self.register_number coop_vals['company_register_number'] = self.register_number
else:
if self.check_belgian_ident_id(self.register_number):
coop_vals['national_register_number'] = self.register_number
if coop_vals: if coop_vals:
cooperator.write(coop_vals) cooperator.write(coop_vals)

1
easy_my_coop/wizard/update_share_line.py

@ -29,7 +29,6 @@ class ShareLineUpdateInfo(models.TransientModel):
@api.multi @api.multi
def update(self): def update(self):
line = self.share_line line = self.share_line
cooperator = line.partner_id cooperator = line.partner_id

1
easy_my_coop_ch/__openerp__.py

@ -32,7 +32,6 @@
""", """,
'data': [ 'data': [
'views/subscription_template.xml', 'views/subscription_template.xml',
'views/subscription_request_view.xml'
], ],
'installable': True, 'installable': True,
} }

6
easy_my_coop_ch/models/coop.py

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

13
easy_my_coop_ch/views/subscription_request_view.xml

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="subscription_request_form" model="ir.ui.view">
<field name="name">subscription.request.form</field>
<field name="model">subscription.request</field>
<field name="inherit_id" ref="easy_my_coop.subscription_request_form"/>
<field name="arch" type="xml">
<field name="no_registre" position="replace"/>
</field>
</record>
</data>
</odoo>

2
easy_my_coop_ch/views/subscription_template.xml

@ -2,7 +2,6 @@
<odoo> <odoo>
<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='iban']/.." position="replace"> <xpath expr="//label[@for='iban']/.." position="replace">
<div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="iban">Bank Account Number</label> <label class="col-md-3 col-sm-4 control-label" for="iban">Bank Account Number</label>
@ -14,7 +13,6 @@
</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='iban']/.." position="replace"> <xpath expr="//label[@for='iban']/.." position="replace">
<div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'iban' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" for="iban">Bank Account Number</label> <label class="col-md-3 col-sm-4 control-label" for="iban">Bank Account Number</label>

6
easy_my_coop_export_xlsx/wizard/export_global_wizard.py

@ -10,7 +10,6 @@ import xlsxwriter
HEADER = [ HEADER = [
'Num. Coop', 'Num. Coop',
'Numero de registre national',
'Nom', 'Nom',
'Email', 'Email',
'Banque', 'Banque',
@ -36,7 +35,6 @@ HEADER2 = [
'Nombre de part', 'Nombre de part',
'Montant', 'Montant',
'Statut', 'Statut',
'Numero de registre national',
'Email', 'Email',
'Mobile', 'Mobile',
'Adresse', 'Adresse',
@ -77,8 +75,6 @@ class export_global_report(models.TransientModel):
i = 0 i = 0
worksheet1.write(j, i, coop.cooperator_register_number) worksheet1.write(j, i, coop.cooperator_register_number)
i += 1 i += 1
worksheet1.write(j, i, coop.national_register_number)
i += 1
worksheet1.write(j, i, coop.name) worksheet1.write(j, i, coop.name)
i += 1 i += 1
worksheet1.write(j, i, coop.email) worksheet1.write(j, i, coop.email)
@ -250,8 +246,6 @@ class export_global_report(models.TransientModel):
i += 1 i += 1
worksheet2.write(j, i, sub_request.state) worksheet2.write(j, i, sub_request.state)
i += 1 i += 1
worksheet2.write(j, i, sub_request.no_registre)
i += 1
worksheet2.write(j, i, sub_request.email) worksheet2.write(j, i, sub_request.email)
i += 1 i += 1
worksheet2.write(j, i, sub_request.phone) worksheet2.write(j, i, sub_request.phone)

5
easy_my_coop_fr/models/coop.py

@ -17,8 +17,3 @@ class SubscriptionRequest(models.Model):
req_fields.remove('iban') req_fields.remove('iban')
return req_fields return req_fields
# override function to disable the check
def check_belgian_identification_id(self, nat_register_num):
# deactivate number validation for french localization
return True

5
easy_my_coop_fr/views/subscription_template.xml

@ -2,10 +2,7 @@
<odoo> <odoo>
<data> <data>
<template id="subscription_i18n" inherit_id="easy_my_coop.becomecooperator" name="Removing fields"> <template id="subscription_i18n" inherit_id="easy_my_coop.becomecooperator" name="Removing fields">
<!-- <xpath expr="//label[@for='no_registre']/.." position="replace">
</xpath> -->
<xpath expr="//label[@for='iban']/.." position="replace">
</xpath>
<xpath expr="//label[@for='iban']/.." position="replace"/>
</template> </template>
</data> </data>
</odoo> </odoo>
Loading…
Cancel
Save