Compare commits

...

99 Commits

Author SHA1 Message Date
Rémy Taymans e053dff6d2 [FIX] emc: One route to rule them all 5 years ago
Rémy Taymans f056eb1b2a [PEP] easy_my_coop main controller 5 years ago
Rémy Taymans e87c7b9e9a [CHG] emc: Hide fields in become_cooperator when user is logged 5 years ago
Elouan Le Bars f406155d5c [FIX] Mandatory field not displayed 5 years ago
Robin Keunen b89635c2b3
Merge pull request #17 from coopiteasy/9.0-fix-install-from-scratch 5 years ago
Elouan Le Bars ac153d748a [IMP] Change approval order for internal rules, data policy and financial risk 5 years ago
Houssine BAKKALI 59a53a7c7a
Merge pull request #22 from coopiteasy/9.0-unrequire-some-fields-when-logged 5 years ago
Houssine BAKKALI e6d669c154
[PEP8] remove unused import 5 years ago
houssine 6e50f34afd [FIX] fix by pass control when iban not given 5 years ago
houssine 8a631f53ed [IMP] put website of CIE 5 years ago
houssine 6481ef3952 [IMP] make some fields non required when logged 5 years ago
Elouan Le Bars 88595b542f [FIX] internal rules checkbox required attribute 5 years ago
Elouan Le Bars 7cf099fec4 [ADD] Financial risk approval on subscription 5 years ago
houssine b70b4f558a [IMP] replace multi by model as we don't work with self 5 years ago
houssine d6c46f6c0e [IMP] get email template from its xml id instead of searching the name 5 years ago
houssine 96bc0e7b58 [FIX] move root menus in a dedicated file to load first 5 years ago
houssine bb4b2ebcb7 [FIX] fix t-att attributes for data policy 5 years ago
houssine c8881872e6 Merge branch '9.0' of https://github.com/coopiteasy/vertical-cooperative.git into 9.0 5 years ago
houssine 1b39e78ce1 [IMP] class name in camel case 5 years ago
Houssine BAKKALI 4ddc8aa933
Merge pull request #18 from coopiteasy/9.0_fix_confirmation_email 5 years ago
houssine 8078b6cedc [IMP] set default_code required when is_share is True 5 years ago
houssine 2a2744dd6b [FIX] fix mix share if statement 5 years ago
houssine 3308dbc4c7 [FIX] fix email confirmation read only when logged. 5 years ago
robin.keunen 54da114669 [IMP] emc: remove cooperative_history_wizard 5 years ago
houssine a412c17042 [FIX] remove duplicate instruction 5 years ago
robin.keunen 31b8b2d8d7 [FIX] easy_my_coop: reorder menu definitions 5 years ago
houssine 373848789b [FIX] fix expected singleton 5 years ago
houssine 1ab411a4de [FIX] fix filter 5 years ago
houssine fc51d8a7ee [FIX] fix again 5 years ago
houssine a722834c45 [FIX] fix filtering expression 5 years ago
Houssine BAKKALI 69744b14c0
Merge pull request #14 from coopiteasy/9.0_add_option_to_wizard 5 years ago
houssine 5af8b99977 [IMP] add filter on sub requests 5 years ago
Houssine BAKKALI 693dc20246
Merge pull request #13 from coopiteasy/9.0_add_option_to_wizard 5 years ago
houssine 36df37fb77 Merge branch '9.0_add_option_to_wizard' of https://github.com/coopiteasy/vertical-cooperative.git into 9.0_add_option_to_wizard 5 years ago
Houssine BAKKALI 3dff9cf9e1 Update update_partner_info.py 5 years ago
Houssine BAKKALI 5934284cff
Update update_partner_info.py 5 years ago
Houssine BAKKALI c62fbfcbe1
Merge pull request #8 from coopiteasy/9-translation-fr-easy-my-coop 5 years ago
houssine d10e1d711c [IMP] option to update birthdate from subscription request 5 years ago
houssine 44d20cad81 [IMP] remove unused import 5 years ago
houssine 90f1e9221a [IMP] add confirmation email on subscription form 5 years ago
houssine ac019e5c92 [IMP] add legal_form to values before partner creation 5 years ago
houssine aa405ce451 [FIX] fix redirection when cooperator is a company 5 years ago
houssine 232d2c2d8c [IMP] fix indentation 5 years ago
houssine 6ab21082e1 [IMP] retrieve value from partner 5 years ago
houssine e24a719c75 [IMP] add legal form field on the partner form 5 years ago
houssine b95f5bd60c [REFACT] remove national register number 5 years ago
houssine d050bb9be3 [IMP] value for the french localization 5 years ago
houssine 2fd6546653 [IMP] add value for the switzerland 5 years ago
houssine 93437ff98f [IMP] add value of the belgian localisation 5 years ago
houssine 8440568f9c [IMP] put class name in camel case 5 years ago
houssine 2938e23a8a [IMP] use selection_add attribute instead of overriding the whole list 5 years ago
houssine 0a91674174 [REFACT] move belgian company type to belgian localisation 5 years ago
houssine 226a804a3b [IMP] retrieve the function on the representative 5 years ago
houssine ab5dd1216f [IMP] made company form's fields readonly when logged 5 years ago
Houssine BAKKALI 1bce9250c4
Merge pull request #10 from coopiteasy/9.0-replace-nnis-by-email 5 years ago
houssine 554a4497b1 [REFACT] remove commented code 5 years ago
houssine 524abfb0b8 [IMP] replace required="True" by required="required" 5 years ago
houssine 08568e3de1 [IMP] change version and update licensing 5 years ago
houssine d4f9fc3d8f [INDENT] fix indentation 5 years ago
houssine 0e8f86195c [PEP] fix pep8 5 years ago
houssine ade9d33cd3 [IMP] make subscription field form read only 5 years ago
houssine f04528b53c [IMP] remove unused variable 5 years ago
houssine c4d854a6d1 [IMP] should be false not is_company 5 years ago
houssine da0653d76b [REFACT] replace national register number by email 5 years ago
houssine f33fa6ec7f [FIX] fix _compute_cooperator_type 5 years ago
houssine 50e7a5f756 [FIX] fix reserved variable name 5 years ago
vdewulf f2f294f71a
Update fr_BE.po for Easy My Coop 5 years ago
Houssine BAKKALI cb17a9c51b
Merge pull request #6 from coopiteasy/9.0_fix_operation_conversion 5 years ago
houssine 83ec48edfe [FIX] company_email doesn't exist on res partner 6 years ago
houssine 80e58389f1 [IMP] remove state dield from there 6 years ago
Houssine BAKKALI ac8e7c1e92
Merge pull request #5 from coopiteasy/9.0-fix-new_coop_form 6 years ago
houssine 53aca0ee6e [IMP] add check in validate function 6 years ago
Rémy Taymans 0ef913acae [FIX] emc: Error casting str to int 6 years ago
Rémy Taymans a5f633b384 [FIX] emc: Data policy and internal rules configuration 6 years ago
Rémy Taymans e494befa02
Merge pull request #4 6 years ago
Rémy Taymans a749c558f9 [IMP] emc: Data policy and internal rules approval 6 years ago
houssine f2597b3220 [PEP8] fix pep8 warning 6 years ago
houssine 0a3fe10446 [FIX] invoice payment information have been moved to another field 6 years ago
houssine 837ed8deaf [IMP] add checkbox already coop on company form 6 years ago
houssine 032b731e5a [FIX] fix checkbox not filled when logged and already coop 6 years ago
Rémy Taymans 623fef4f08 [FIX] emc: Order of approvals checkbox in new cooperator form 6 years ago
Rémy Taymans 03776220e3
Merge pull request #2 6 years ago
Rémy Taymans 54dcbd82ff [ADD] emc: Internal Rules Approved 6 years ago
Rémy Taymans 123aabf756 [CHG] emc: Remove dependence to website_legal_page 6 years ago
Rémy Taymans cdc6d083b6 [REF] emc: Duplicate key 'customer' 6 years ago
Rémy Taymans 5911b3e5bc [IMP] emc: Complete data_policy_approved processing 6 years ago
robinkeunen d7b431a202 [IMP] align already cooperator checkbox 7 years ago
robinkeunen afc28114aa [IMP] align send button 7 years ago
robinkeunen cb4a6ab8be [ADD] add website_legal_page and link to legal pages 7 years ago
robinkeunen 96f0b7f0d6 [ADD] require data policy approval 7 years ago
houssine 91dc06fc4e [IMP] take hard coded value from company field 6 years ago
houssine d909c3d32c [FIX] fix wrong field name 6 years ago
houssine 20dad701d6 [IMP] make release capital tree view use the customer invoice view tree 6 years ago
houssine ee6463c0dc [FIX] fix export. removing an old field 6 years ago
houssine f2478c9312 [IMP] make validation on iban only if iban is not empty 6 years ago
houssine ab62e69d6d [IMP] make iban field non required 6 years ago
houssine 18dce65cdc [IMP] set iban non required for this localisation 6 years ago
houssine e7cbc31932 [FIX] check no_registre only if it's required for the localisation 6 years ago
houssine 90969b1fef [FIX] fix undeclared variable domain is a special case 6 years ago
  1. 26
      easy_my_coop/__openerp__.py
  2. 111
      easy_my_coop/controllers/main.py
  3. 800
      easy_my_coop/i18n/fr_BE.po
  4. 15
      easy_my_coop/migrations/9.1.0.0.2/pre-migration.py
  5. 8
      easy_my_coop/models/account_invoice.py
  6. 68
      easy_my_coop/models/company.py
  7. 112
      easy_my_coop/models/coop.py
  8. 10
      easy_my_coop/models/operation_request.py
  9. 30
      easy_my_coop/models/partner.py
  10. 2
      easy_my_coop/view/account_invoice_view.xml
  11. 1
      easy_my_coop/view/cooperator_register_view.xml
  12. 2
      easy_my_coop/view/email_template_view.xml
  13. 33
      easy_my_coop/view/menu.xml
  14. 8
      easy_my_coop/view/menu_item_view.xml
  15. 8
      easy_my_coop/view/operation_request_view.xml
  16. 11
      easy_my_coop/view/product_view.xml
  17. 9
      easy_my_coop/view/res_company_view.xml
  18. 11
      easy_my_coop/view/res_partner_view.xml
  19. 11
      easy_my_coop/view/subscription_request_view.xml
  20. 263
      easy_my_coop/view/subscription_template.xml
  21. 41
      easy_my_coop/wizard/cooperative_history_wizard.xml
  22. 38
      easy_my_coop/wizard/create_subscription_from_partner.py
  23. 2
      easy_my_coop/wizard/create_subscription_from_partner.xml
  24. 52
      easy_my_coop/wizard/update_partner_info.py
  25. 7
      easy_my_coop/wizard/update_partner_info.xml
  26. 1
      easy_my_coop/wizard/update_share_line.py
  27. 1
      easy_my_coop_be/__init__.py
  28. 2
      easy_my_coop_be/models/__init__.py
  29. 11
      easy_my_coop_be/models/coop.py
  30. 11
      easy_my_coop_be/models/partner.py
  31. 1
      easy_my_coop_ch/__openerp__.py
  32. 1
      easy_my_coop_ch/models/__init__.py
  33. 17
      easy_my_coop_ch/models/coop.py
  34. 17
      easy_my_coop_ch/models/partner.py
  35. 13
      easy_my_coop_ch/views/subscription_request_view.xml
  36. 18
      easy_my_coop_ch/views/subscription_template.xml
  37. 14
      easy_my_coop_export_xlsx/wizard/export_global_wizard.py
  38. 1
      easy_my_coop_fr/models/__init__.py
  39. 10
      easy_my_coop_fr/models/coop.py
  40. 13
      easy_my_coop_fr/models/partner.py
  41. 5
      easy_my_coop_fr/views/subscription_template.xml
  42. 1
      easy_my_coop_online_payment/controllers/main.py
  43. 2
      easy_my_coop_website_document/__openerp__.py
  44. 2
      easy_my_coop_website_portal/__openerp__.py
  45. 2
      easy_my_coop_website_taxshelter/__openerp__.py
  46. 2
      website_portal_extend/__openerp__.py

26
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": "1.1",
"version": "9.1.0.0.2",
"depends": ["base", "depends": ["base",
"sale", "sale",
"purchase", "purchase",
@ -46,6 +30,7 @@
'data': [ 'data': [
'security/easy_my_coop_security.xml', 'security/easy_my_coop_security.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
'view/menu_item_view.xml',
'wizard/create_subscription_from_partner.xml', 'wizard/create_subscription_from_partner.xml',
'wizard/update_partner_info.xml', 'wizard/update_partner_info.xml',
'wizard/validate_subscription_request.xml', 'wizard/validate_subscription_request.xml',
@ -60,6 +45,7 @@
'view/product_view.xml', 'view/product_view.xml',
'view/res_company_view.xml', 'view/res_company_view.xml',
'view/account_journal_view.xml', 'view/account_journal_view.xml',
'view/menu.xml',
'data/easy_my_coop_data.xml', 'data/easy_my_coop_data.xml',
'report/easy_my_coop_report.xml', 'report/easy_my_coop_report.xml',
'report/cooperator_invoice_G002.xml', 'report/cooperator_invoice_G002.xml',

111
easy_my_coop/controllers/main.py

@ -13,15 +13,15 @@ _TECHNICAL = ['view_from', 'view_callback']
_BLACKLIST = ['id', 'create_uid', 'create_date', 'write_uid', 'write_date', _BLACKLIST = ['id', 'create_uid', 'create_date', 'write_uid', 'write_date',
'user_id', 'active'] 'user_id', 'active']
_COOP_FORM_FIELD = ['email', 'firstname', 'lastname', 'birthdate', 'iban',
'share_product_id', 'no_registre', 'address', 'city',
_COOP_FORM_FIELD = ['email', 'confirm_email', 'firstname', 'lastname',
'birthdate', 'iban', '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']
@ -32,13 +32,15 @@ class WebsiteSubscription(http.Controller):
'/become_cooperator'], '/become_cooperator'],
type='http', auth="public", website=True) type='http', auth="public", website=True)
def display_become_cooperator_page(self, **kwargs): def display_become_cooperator_page(self, **kwargs):
if request.httprequest.method == "POST":
return self.share_subscription(**kwargs)
values = {} values = {}
logged = False logged = False
if request.env.user.login != 'public': if request.env.user.login != 'public':
logged = True logged = True
partner = request.env.user.partner_id partner = request.env.user.partner_id
if partner.is_company: if partner.is_company:
return request.website.render("easy_my_coop.becomecompanycooperator", values)
return self.display_become_company_cooperator_page()
values = self.fill_values(values, False, logged, True) values = self.fill_values(values, False, logged, True)
for field in _COOP_FORM_FIELD: for field in _COOP_FORM_FIELD:
@ -52,6 +54,8 @@ class WebsiteSubscription(http.Controller):
'/become_company_cooperator'], '/become_company_cooperator'],
type='http', auth="public", website=True) type='http', auth="public", website=True)
def display_become_company_cooperator_page(self, **kwargs): def display_become_company_cooperator_page(self, **kwargs):
if request.httprequest.method == "POST":
return self.share_subscription(**kwargs)
values = {} values = {}
logged = False logged = False
@ -63,7 +67,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 """
@ -99,9 +104,12 @@ class WebsiteSubscription(http.Controller):
if is_company: if is_company:
# company values # company values
values['company_register_number'] = partner.company_register_number
values['company_register_number'] = (
partner.company_register_number
)
values['company_name'] = partner.name values['company_name'] = partner.name
values['company_email'] = partner.email values['company_email'] = partner.email
values['company_type'] = partner.legal_form
# contact person values # contact person values
representative = partner.get_representative() representative = partner.get_representative()
values['firstname'] = representative.firstname values['firstname'] = representative.firstname
@ -109,8 +117,9 @@ 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
else: else:
@ -118,7 +127,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
@ -163,6 +171,19 @@ class WebsiteSubscription(http.Controller):
if not values.get('lang'): if not values.get('lang'):
if company.default_lang_id: if company.default_lang_id:
values['lang'] = company.default_lang_id.code values['lang'] = company.default_lang_id.code
comp = request.env['res.company']._company_default_get()
values.update({
'display_internal_rules': comp.display_internal_rules_approval,
'internal_rules_required': comp.internal_rules_approval_required,
'internal_rules_text': comp.internal_rules_approval_text,
'display_data_policy': comp.display_data_policy_approval,
'data_policy_required': comp.data_policy_approval_required,
'data_policy_text': comp.data_policy_approval_text,
'display_financial_risk': comp.display_financial_risk_approval,
'financial_risk_required': comp.financial_risk_approval_required,
'financial_risk_text': comp.financial_risk_approval_text,
})
return values return values
def get_products_share(self, is_company): def get_products_share(self, is_company):
@ -185,6 +206,11 @@ class WebsiteSubscription(http.Controller):
product_id = kwargs.get("share_product_id") product_id = kwargs.get("share_product_id")
return prod_obj.sudo().browse(int(product_id)).product_variant_ids[0] return prod_obj.sudo().browse(int(product_id)).product_variant_ids[0]
def remove_field_from_list(self, required_fields, field):
if required_fields.count(field) > 0:
required_fields.remove(field)
return required_fields
def validation(self, kwargs, logged, values, post_file): def validation(self, kwargs, logged, values, post_file):
user_obj = request.env['res.users'] user_obj = request.env['res.users']
sub_req_obj = request.env['subscription.request'] sub_req_obj = request.env['subscription.request']
@ -210,7 +236,15 @@ class WebsiteSubscription(http.Controller):
# Check that required field from model subscription_request exists # Check that required field from model subscription_request exists
required_fields = sub_req_obj.sudo().get_required_field() required_fields = sub_req_obj.sudo().get_required_field()
error = set(field for field in required_fields if not values.get(field)) #noqa
if logged:
# these fields are readonly when logged
# we want to ease the process if user was a subscriber
self.remove_field_from_list(required_fields, 'iban')
self.remove_field_from_list(required_fields, 'birthdate')
error = set(
field for field in required_fields if not values.get(field)
)
if error: if error:
values = self.fill_values(values, is_company, logged) values = self.fill_values(values, is_company, logged)
@ -229,6 +263,15 @@ class WebsiteSubscription(http.Controller):
"fill in the form") "fill in the form")
return request.website.render(redirect, values) return request.website.render(redirect, values)
else:
confirm_email = kwargs.get('confirm_email')
if email != confirm_email:
values = self.fill_values(values, is_company, logged)
values.update(kwargs)
values["error_msg"] = _("The email and the confirmation "
"email doesn't match.Please check "
"the given mail addresses")
return request.website.render(redirect, values)
company = request.website.company_id company = request.website.company_id
if company.allow_id_card_upload: if company.allow_id_card_upload:
@ -240,6 +283,7 @@ class WebsiteSubscription(http.Controller):
return request.website.render(redirect, values) return request.website.render(redirect, values)
iban = kwargs.get("iban") iban = kwargs.get("iban")
if iban:
valid = sub_req_obj.check_iban(iban) valid = sub_req_obj.check_iban(iban)
if not valid: if not valid:
@ -248,17 +292,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:
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:
@ -267,7 +300,7 @@ class WebsiteSubscription(http.Controller):
max_amount = max_amount - partner.total_value max_amount = max_amount - partner.total_value
if company.unmix_share_type: if company.unmix_share_type:
share = self.get_selected_share(kwargs) share = self.get_selected_share(kwargs)
if int(partner.cooperator_type) != share.id:
if partner.cooperator_type != share.default_code:
values = self.fill_values(values, is_company, logged) values = self.fill_values(values, is_company, logged)
values["error_msg"] = (_("You can't subscribe two " values["error_msg"] = (_("You can't subscribe two "
"different types of share")) "different types of share"))
@ -298,12 +331,10 @@ class WebsiteSubscription(http.Controller):
} }
} }
@http.route(['/subscription/subscribe_share'],
type='http',
auth="public", website=True)
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']
# 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 = []
# Info to add after the message # Info to add after the message
@ -338,29 +369,39 @@ class WebsiteSubscription(http.Controller):
values["already_cooperator"] = already_coop values["already_cooperator"] = already_coop
values["is_company"] = is_company values["is_company"] = is_company
if kwargs.get('internal_rules_approved', 'off') == 'on':
values['internal_rules_approved'] = True
if kwargs.get('data_policy_approved', 'off') == 'on':
values['data_policy_approved'] = True
if kwargs.get('financial_risk_approved', 'off') == 'on':
values['financial_risk_approved'] = True
lastname = kwargs.get("lastname").upper() lastname = kwargs.get("lastname").upper()
firstname = kwargs.get("firstname").title() firstname = kwargs.get("firstname").title()
values["name"] = firstname + " " + lastname values["name"] = firstname + " " + lastname
values["lastname"] = lastname values["lastname"] = lastname
values["firstname"] = firstname values["firstname"] = firstname
values["birthdate"] = datetime.strptime(kwargs.get("birthdate"),
"%d/%m/%Y").date()
birthdate = kwargs.get("birthdate")
if birthdate:
values["birthdate"] = datetime.strptime(birthdate,
("%d/%m/%Y")).date()
else:
values["birthdate"] = False
values["source"] = "website" values["source"] = "website"
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):
values["company_register_number"] = re.sub('[^0-9a-zA-Z]+',
'',
kwargs.get("company_register_number"))
values['company_type'] = kwargs.get("company_type")
if kwargs.get("company_register_number", False):
values["company_register_number"] = re.sub(
'[^0-9a-zA-Z]+', '', 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:
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:

800
easy_my_coop/i18n/fr_BE.po
File diff suppressed because it is too large
View File

15
easy_my_coop/migrations/9.1.0.0.2/pre-migration.py

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
def migrate(cr, version):
if not version:
return
cr.execute("UPDATE res_company "
"SET internal_rules_approval_required = FALSE "
"WHERE display_internal_rules_approval = FALSE")
cr.execute("UPDATE res_company "
"SET data_policy_approval_required = FALSE "
"WHERE display_data_policy_approval = FALSE")
cr.execute("UPDATE res_company "
"SET financial_risk_approval_required = FALSE "
"WHERE display_financial_risk_approval = FALSE")

8
easy_my_coop/models/account_invoice.py

@ -3,7 +3,7 @@ from datetime import datetime
from openerp import api, fields, models from openerp import api, fields, models
class account_invoice(models.Model):
class AccountInvoice(models.Model):
_inherit = 'account.invoice' _inherit = 'account.invoice'
subscription_request = fields.Many2one('subscription.request', subscription_request = fields.Many2one('subscription.request',
@ -14,7 +14,7 @@ class account_invoice(models.Model):
@api.model @api.model
def _prepare_refund(self, invoice, date_invoice=None, date=None, def _prepare_refund(self, invoice, date_invoice=None, date=None,
description=None, journal_id=None): description=None, journal_id=None):
values = super(account_invoice, self)._prepare_refund(
values = super(AccountInvoice, self)._prepare_refund(
invoice, date_invoice, date, invoice, date_invoice, date,
description, journal_id) description, journal_id)
values['release_capital_request'] = self.release_capital_request values['release_capital_request'] = self.release_capital_request
@ -24,8 +24,6 @@ class account_invoice(models.Model):
def create_user(self, partner): def create_user(self, partner):
user_obj = self.env['res.users'] user_obj = self.env['res.users']
email = partner.email email = partner.email
if partner.is_company:
email = partner.company_email
user = user_obj.search([('login', '=', email)]) user = user_obj.search([('login', '=', email)])
if not user: if not user:
@ -98,7 +96,7 @@ class account_invoice(models.Model):
@api.multi @api.multi
def confirm_paid(self): def confirm_paid(self):
for invoice in self: for invoice in self:
super(account_invoice, invoice).confirm_paid()
super(AccountInvoice, invoice).confirm_paid()
# we check if there is an open refund for this invoice. in this # we check if there is an open refund for this invoice. in this
# case we don't run the process_subscription function as the # case we don't run the process_subscription function as the
# invoice has been reconciled with a refund and not a payment. # invoice has been reconciled with a refund and not a payment.

68
easy_my_coop/models/company.py

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from openerp import fields, models
from openerp import api, fields, models
class ResCompany(models.Model): class ResCompany(models.Model):
@ -44,3 +44,69 @@ class ResCompany(models.Model):
bottom_logo2 = fields.Binary(string="Bottom logo 2") bottom_logo2 = fields.Binary(string="Bottom logo 2")
logo_url = fields.Char(string="logo url", logo_url = fields.Char(string="logo url",
compute="_get_base_logo") compute="_get_base_logo")
display_internal_rules_approval = fields.Boolean(
help="Choose to display an internal rules checkbox on the"
" cooperator website form."
)
internal_rules_approval_required = fields.Boolean(
string="Is internal rules approval required?"
)
internal_rules_approval_text = fields.Html(
translate=True,
help="Text to display aside the checkbox to approve internal rules."
)
display_data_policy_approval = fields.Boolean(
help="Choose to display a data policy checkbox on the cooperator"
" website form."
)
data_policy_approval_required = fields.Boolean(
string="Is data policy approval required?"
)
data_policy_approval_text = fields.Html(
translate=True,
help="Text to display aside the checkbox to approve data policy."
)
display_financial_risk_approval = fields.Boolean(
help="Choose to display a financial risk checkbox on the"
" cooperator website form."
)
financial_risk_approval_required = fields.Boolean(
string="Is financial risk approval required?"
)
financial_risk_approval_text = fields.Html(
translate=True,
help="Text to display aside the checkbox to approve financial risk."
)
@api.onchange('internal_rules_approval_required')
def onchange_internal_rules_approval_required(self):
if self.internal_rules_approval_required:
self.display_internal_rules_approval = True
@api.onchange('data_policy_approval_required')
def onchange_data_policy_approval_required(self):
if self.data_policy_approval_required:
self.display_data_policy_approval = True
@api.onchange('financial_risk_approval_required')
def onchange_financial_risk_approval_required(self):
if self.financial_risk_approval_required:
self.display_financial_risk_rules_approval = True
_sql_constraints = [(
'approval_constraint',
"""CHECK (((internal_rules_approval_required=FALSE
AND display_internal_rules_approval=FALSE)
OR display_internal_rules_approval=TRUE)
AND ((data_policy_approval_required=FALSE
AND display_data_policy_approval=FALSE)
OR display_data_policy_approval=TRUE)
AND ((financial_risk_approval_required=FALSE
AND display_financial_risk_approval=FALSE)
OR display_financial_risk_approval=TRUE))
""",
"Approval can't be mandatory and not displayed."
)]

112
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
@ -30,19 +29,27 @@ class subscription_request(models.Model):
_description = 'Subscription Request' _description = 'Subscription Request'
def get_required_field(self): def get_required_field(self):
return _REQUIRED
required_fields = _REQUIRED
company = self.env['res.company']._company_default_get()
if company.internal_rules_approval_required:
required_fields.append('internal_rules_approved')
if company.data_policy_approval_required:
required_fields.append('data_policy_approved')
if company.financial_risk_approval_required:
required_fields.append('financial_risk_approved')
return required_fields
@api.model @api.model
def create(self, vals): def create(self, vals):
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'
@ -83,22 +90,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
@ -113,17 +104,12 @@ 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)
if validated and (sub_request.skip_control_ng or
self.check_belgian_identification_id(
sub_request.no_registre)):
validated = True
else:
validated = False
validated = (self.check_iban(sub_request.iban)
or sub_request.skip_control_ng
)
sub_request.validated = validated sub_request.validated = validated
@api.multi @api.multi
@ -228,9 +214,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)
@ -254,8 +237,11 @@ class subscription_request(models.Model):
required=True, required=True,
readonly=True, readonly=True,
states={'draft': [('readonly', False)]}, states={'draft': [('readonly', False)]},
default=lambda self: datetime.strftime(datetime.now(), '%Y-%m-%d'))
company_id = fields.Many2one('res.company', string='Company', required=True,
default=lambda self: datetime.strftime(datetime.now(),
'%Y-%m-%d'))
company_id = fields.Many2one('res.company',
string='Company',
required=True,
change_default=True, change_default=True,
readonly=True, readonly=True,
default=lambda self: self.env['res.company']._company_default_get()) default=lambda self: self.env['res.company']._company_default_get())
@ -274,11 +260,7 @@ class subscription_request(models.Model):
company_register_number = fields.Char(string='Company register number', company_register_number = fields.Char(string='Company register number',
readonly=True, readonly=True,
states={'draft': [('readonly', False)]}) states={'draft': [('readonly', False)]})
company_type = fields.Selection([('scrl', 'SCRL'),
('asbl', 'ASBL'),
('sprl', 'SPRL'),
('sa', 'SA'),
('other', 'Other')],
company_type = fields.Selection([('', '')],
string="Company type", string="Company type",
readonly=True, readonly=True,
states={'draft': [('readonly', False)]}) states={'draft': [('readonly', False)]})
@ -326,13 +308,24 @@ class subscription_request(models.Model):
default="website", default="website",
readonly=True, readonly=True,
states={'draft': [('readonly', False)]}) states={'draft': [('readonly', False)]})
internal_rules_approved = fields.Boolean(
string='Internal Rules Approved ',
default=False,
)
data_policy_approved = fields.Boolean(
string='Data Policy Approved',
default=False,
)
financial_risk_approved = fields.Boolean(
string='Financial Risk Approved',
default=False,
)
_order = "id desc" _order = "id desc"
def get_person_info(self, partner): def get_person_info(self, partner):
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
@ -391,7 +384,7 @@ class subscription_request(models.Model):
return res return res
def send_capital_release_request(self, invoice): def send_capital_release_request(self, invoice):
invoice_email_template = self.env['mail.template'].search([('name', '=', 'Request to Release Capital - Send by Email')])[0]
invoice_email_template = self.env.ref('easy_my_coop.email_template_release_capital', False)
# we send the email with the capital release request in attachment # we send the email with the capital release request in attachment
invoice_email_template.send_mail(invoice.id, True) invoice_email_template.send_mail(invoice.id, True)
@ -433,15 +426,20 @@ class subscription_request(models.Model):
partner_vals = {'name': self.company_name, partner_vals = {'name': self.company_name,
'last_name': self.company_name, 'last_name': self.company_name,
'is_company': self.is_company, 'is_company': self.is_company,
'legal_form': self.company_type,
'company_register_number': self.company_register_number, #noqa 'company_register_number': self.company_register_number, #noqa
'customer': False, 'cooperator': True,
'cooperator': True,
'street': self.address, 'zip': self.zip_code, 'street': self.address, 'zip': self.zip_code,
'city': self.city, 'email': self.company_email, 'city': self.city, 'email': self.company_email,
'out_inv_comm_type': 'bba', 'out_inv_comm_type': 'bba',
'customer': self.share_product_id.customer, 'customer': self.share_product_id.customer,
'out_inv_comm_algorithm': 'random', 'out_inv_comm_algorithm': 'random',
'country_id': self.country_id.id, 'country_id': self.country_id.id,
'lang': self.lang}
'lang': self.lang,
'internal_rules_approved': self.internal_rules_approved,
'data_policy_approved': self.data_policy_approved,
'financial_risk_approved': self.financial_risk_approved
}
return partner_vals return partner_vals
def get_partner_vals(self): def get_partner_vals(self):
@ -450,12 +448,15 @@ 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,
'birthdate_date': self.birthdate, 'birthdate_date': self.birthdate,
'customer': self.share_product_id.customer}
'customer': self.share_product_id.customer,
'internal_rules_approved': self.internal_rules_approved,
'data_policy_approved': self.data_policy_approved,
'financial_risk_approved': self.financial_risk_approved
}
return partner_vals return partner_vals
def create_coop_partner(self): def create_coop_partner(self):
@ -486,14 +487,16 @@ class subscription_request(models.Model):
partner = self.partner_id partner = self.partner_id
else: else:
partner = None partner = None
domain = []
if self.already_cooperator: if self.already_cooperator:
raise UserError(_('The checkbox already cooperator is' raise UserError(_('The checkbox already cooperator is'
' 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:
partner = partner_obj.search(domain) partner = partner_obj.search(domain)
if not partner: if not partner:
@ -503,8 +506,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'
@ -516,7 +519,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',
@ -525,7 +527,11 @@ class subscription_request(models.Model):
'parent_id': partner.id, 'parent_id': partner.id,
'representative': True, 'representative': True,
'function': self.contact_person_function, 'function': self.contact_person_function,
'type': 'representative'}
'type': 'representative',
'internal_rules_approved': self.internal_rules_approved,
'data_policy_approved': self.data_policy_approved,
'financial_risk_approved': self.financial_risk_approved
}
contact = partner_obj.create(contact_vals) contact = partner_obj.create(contact_vals)
else: else:
if len(contact) > 1: if len(contact) > 1:

10
easy_my_coop/models/operation_request.py

@ -115,7 +115,8 @@ class operation_request(models.Model):
def get_total_share_dic(self, partner): def get_total_share_dic(self, partner):
total_share_dic = {} total_share_dic = {}
share_products = self.env['product.template'].search([('is_share', '=', True)])
prod_template_obj = self.env['product.template']
share_products = prod_template_obj.search([('is_share', '=', True)])
for share_product in share_products: for share_product in share_products:
total_share_dic[share_product.id] = 0 total_share_dic[share_product.id] = 0
@ -174,6 +175,13 @@ class operation_request(models.Model):
" shares that he/she owns.")) " shares that he/she owns."))
if self.operation_type == 'convert': if self.operation_type == 'convert':
amount_to_convert = self.share_unit_price * self.quantity
share_price = self.share_to_product_id.list_price
remainder = amount_to_convert % share_price
if remainder != 0:
raise ValidationError(_("The conversion must give a whole"
" number for quantity"))
if self.company_id.unmix_share_type: if self.company_id.unmix_share_type:
if self.share_product_id.code == self.share_to_product_id.code: if self.share_product_id.code == self.share_to_product_id.code:
raise ValidationError(_("You can't convert the share to" raise ValidationError(_("You can't convert the share to"

30
easy_my_coop/models/partner.py

@ -59,12 +59,13 @@ class ResPartner(models.Model):
for partner, child_ids in all_partners_and_children.items(): for partner, child_ids in all_partners_and_children.items():
partner.total_invoiced = sum(price['total'] for price in price_totals if price['partner_id'] in child_ids) partner.total_invoiced = sum(price['total'] for price in price_totals if price['partner_id'] in child_ids)
@api.multi
@api.model
def _get_share_type(self): def _get_share_type(self):
product_obj = self.env['product.product'] product_obj = self.env['product.product']
share_type_list = [('', '')] share_type_list = [('', '')]
for share_type in product_obj.search([('is_share', '=', True)]): for share_type in product_obj.search([('is_share', '=', True)]):
share_type_list.append((str(share_type.id), share_type.short_name))
share_type_list.append([share_type.default_code,
share_type.short_name])
return share_type_list return share_type_list
@api.multi @api.multi
@ -76,12 +77,14 @@ class ResPartner(models.Model):
partner.effective_date = partner.share_ids[0].effective_date partner.effective_date = partner.share_ids[0].effective_date
@api.multi @api.multi
@api.depends('share_ids')
@api.depends('share_ids', 'share_ids.share_product_id',
'share_ids.share_product_id.default_code',
'share_ids.share_number')
def _compute_cooperator_type(self): def _compute_cooperator_type(self):
for partner in self: for partner in self:
share_type = '' share_type = ''
for line in partner.share_ids: for line in partner.share_ids:
share_type = str(line.share_product_id.id)
share_type = str(line.share_product_id.default_code)
if share_type != '': if share_type != '':
partner.cooperator_type = share_type partner.cooperator_type = share_type
@ -119,16 +122,16 @@ class ResPartner(models.Model):
'partner_id', 'partner_id',
string='Share Lines') string='Share Lines')
cooperator_register_number = fields.Integer(string='Cooperator Number') cooperator_register_number = fields.Integer(string='Cooperator Number')
number_of_share = fields.Integer(compute="_compute_share_info",
number_of_share = fields.Integer(compute=_compute_share_info,
multi='share', multi='share',
string='Number of share', string='Number of share',
readonly=True) readonly=True)
total_value = fields.Float(compute="_compute_share_info",
total_value = fields.Float(compute=_compute_share_info,
multi='share', multi='share',
string='Total value of shares', string='Total value of shares',
readonly=True) readonly=True)
company_register_number = fields.Char(string='Company Register Number') company_register_number = fields.Char(string='Company Register Number')
cooperator_type = fields.Selection(selection='_get_share_type',
cooperator_type = fields.Selection(selection=_get_share_type,
compute=_compute_cooperator_type, compute=_compute_cooperator_type,
string='Cooperator Type', string='Cooperator Type',
store=True) store=True)
@ -139,6 +142,11 @@ class ResPartner(models.Model):
subscription_request_ids = fields.One2many('subscription.request', subscription_request_ids = fields.One2many('subscription.request',
'partner_id', 'partner_id',
string="Subscription request") string="Subscription request")
legal_form = fields.Selection([('', '')],
string="Legal form")
internal_rules_approved = fields.Boolean(string="Internal Rules Approved ")
data_policy_approved = fields.Boolean(string="Data Policy Approved ")
financial_risk_approved = fields.Boolean(string="Financial Risk Approved ")
@api.multi @api.multi
@api.depends('subscription_request_ids.state') @api.depends('subscription_request_ids.state')
@ -162,10 +170,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)])

2
easy_my_coop/view/account_invoice_view.xml

@ -38,6 +38,7 @@
<record id="action_invoice_tree1_view1" model="ir.actions.act_window.view"> <record id="action_invoice_tree1_view1" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/> <field eval="1" name="sequence"/>
<field name="view_mode">tree</field> <field name="view_mode">tree</field>
<field name="view_id" ref="account.invoice_tree"/>
<field name="act_window_id" ref="action_invoice_tree_coop"/> <field name="act_window_id" ref="action_invoice_tree_coop"/>
</record> </record>
@ -48,7 +49,6 @@
<field name="act_window_id" ref="action_invoice_tree_coop"/> <field name="act_window_id" ref="action_invoice_tree_coop"/>
</record> </record>
<menuitem action="action_invoice_tree_coop" id="menu_action_invoice_tree_coop" parent="menu_easy_my_coop_main_coop" groups="easy_my_coop.group_energiris_user"/>
<record id="account.action_invoice_tree1" model="ir.actions.act_window"> <record id="account.action_invoice_tree1" model="ir.actions.act_window">
<field name="name">Customer Invoices</field> <field name="name">Customer Invoices</field>

1
easy_my_coop/view/cooperator_register_view.xml

@ -75,6 +75,5 @@
<field name="search_view_id" ref="view_subscription_register_filter"/> <field name="search_view_id" ref="view_subscription_register_filter"/>
</record> </record>
<menuitem action="subscription_register_action" name="Subscription Register" id="menu_easy_my_coop_subscription_register" parent="menu_easy_my_coop_main_subscription" sequence="20"/>
</data> </data>
</openerp> </openerp>

2
easy_my_coop/view/email_template_view.xml

@ -1,6 +1,5 @@
<openerp> <openerp>
<data> <data>
<menuitem name="Configuration" id="menu_easy_my_coop_config" parent="menu_main_easy_my_coop" sequence="20"/>
<record model="ir.actions.act_window" id="action_easy_my_coop_email_templates"> <record model="ir.actions.act_window" id="action_easy_my_coop_email_templates">
<field name="name">Mail Templates</field> <field name="name">Mail Templates</field>
@ -11,6 +10,5 @@
<field name="search_view_id" ref="mail.view_email_template_search"/> <field name="search_view_id" ref="mail.view_email_template_search"/>
</record> </record>
<menuitem id="menu_easy_my_coop_templates" parent="menu_easy_my_coop_config" action="action_easy_my_coop_email_templates" sequence="10" groups="group_energiris_manager"/>
</data> </data>
</openerp> </openerp>

33
easy_my_coop/view/menu.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2019 Coop IT Easy
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<!-- top menus -->
<menuitem name="Easy-My Coop" id="menu_main_easy_my_coop" sequence="40" groups="easy_my_coop.group_energiris_user"/>
<menuitem name="Cooperators" id="menu_easy_my_coop_main_coop" parent="menu_main_easy_my_coop" sequence="5" />
<menuitem name="Subscription" id="menu_easy_my_coop_main_subscription" parent="menu_main_easy_my_coop" sequence="10" groups="easy_my_coop.group_energiris_manager"/>
<menuitem name="Reporting" id="menu_easy_my_coop_main_reporting" parent="menu_main_easy_my_coop" sequence="40" groups="easy_my_coop.group_energiris_manager"/>
<menuitem name="Configuration" id="menu_easy_my_coop_config" parent="menu_main_easy_my_coop" sequence="20"/>
<!-- views -->
<menuitem action="action_invoice_tree_coop" id="menu_action_invoice_tree_coop" parent="menu_easy_my_coop_main_coop" groups="easy_my_coop.group_energiris_user"/>
<menuitem id="menu_easy_my_coop_cooperator" name="Cooperators" parent="menu_easy_my_coop_main_coop" action="action_partner_cooperator_form" sequence="100"/>
<menuitem id="menu_easy_my_coop_cooperator_candidate" name="Cooperator Candidates" parent="menu_easy_my_coop_main_coop" action="action_partner_cooperator_candidate_form" sequence="150"/>
<menuitem id="menu_easy_my_coop_company_representative" name="Company representative" parent="menu_easy_my_coop_main_coop" action="action_company_representative_form" sequence="160"/>
<menuitem action="subscription_register_action" name="Subscription Register" id="menu_easy_my_coop_subscription_register" parent="menu_easy_my_coop_main_subscription" sequence="20"/>
<menuitem action="operation_request_action" name="Operation request" id="menu_easy_my_coop_operation_request" parent="menu_easy_my_coop_main_subscription" sequence="20" groups="easy_my_coop.group_energiris_manager"/>
<menuitem action="share_product_action" name="Share type" id="menu_easy_my_coop_share_product" parent="menu_easy_my_coop_main_subscription" sequence="20"/>
<menuitem action="subscription_request_action" name="Cooperator Subscription" id="menu_easy_my_coop_subscription_request" parent="menu_easy_my_coop_main_subscription" sequence="10"/>
<menuitem action="company_subscription_request_action" name="Company Subscription" id="menu_easy_my_coop_company_subscription_request" parent="menu_easy_my_coop_main_subscription" sequence="12"/>
<menuitem action="share_line_action" name="Share lines" id="menu_easy_my_coop_share_line" parent="menu_easy_my_coop_main_subscription" sequence="20" groups="group_energiris_super_manager"/>
<menuitem id="menu_easy_my_coop_templates" parent="menu_easy_my_coop_config" action="action_easy_my_coop_email_templates" sequence="10" groups="group_energiris_manager"/>
<!-- wizards -->
<menuitem action="action_view_update_partner_info" name="Update coop partner" id="menu_view_update_partner_info" parent="menu_easy_my_coop_main_subscription" sequence="60" groups="base.group_system"/>
</odoo>

8
easy_my_coop/view/menu_item_view.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<menuitem name="Easy-My Coop" id="menu_main_easy_my_coop" sequence="40" groups="easy_my_coop.group_energiris_user"/>
<menuitem name="Subscription" id="menu_easy_my_coop_main_subscription" parent="menu_main_easy_my_coop" sequence="10" groups="easy_my_coop.group_energiris_manager"/>
<menuitem name="Reporting" id="menu_easy_my_coop_main_reporting" parent="menu_main_easy_my_coop" sequence="40" groups="easy_my_coop.group_energiris_manager"/>
</data>
</odoo>

8
easy_my_coop/view/operation_request_view.xml

@ -32,7 +32,6 @@
<sheet> <sheet>
<group> <group>
<group> <group>
<field name="state"/>
<field name="request_date" attrs="{'readonly':[('state','!=','draft')]}"/> <field name="request_date" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="operation_type" attrs="{'readonly':[('state','!=','draft')]}"/> <field name="operation_type" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="receiver_not_member" attrs="{'invisible':[('operation_type','!=','transfer')]}"/> <field name="receiver_not_member" attrs="{'invisible':[('operation_type','!=','transfer')]}"/>
@ -54,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>
@ -68,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>
@ -105,6 +102,5 @@
<field name="view_id" ref="operation_request_tree"/> <field name="view_id" ref="operation_request_tree"/>
</record> </record>
<menuitem action="operation_request_action" name="Operation request" id="menu_easy_my_coop_operation_request" parent="menu_easy_my_coop_main_subscription" sequence="20" groups="easy_my_coop.group_energiris_manager"/>
</data> </data>
</openerp> </openerp>

11
easy_my_coop/view/product_view.xml

@ -36,6 +36,16 @@
</field> </field>
</record> </record>
<record id="product_template_only_form_view" model="ir.ui.view">
<field name="name">product.template.product.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<field name="default_code" position="attributes">
<attribute name="attrs">{'required': [('is_share', '=', True)]}</attribute>
</field>
</field>
</record>
<record id="share_product_action" model="ir.actions.act_window"> <record id="share_product_action" model="ir.actions.act_window">
<field name="name">Share type</field> <field name="name">Share type</field>
@ -54,7 +64,6 @@
</field> </field>
</record> </record>
<menuitem action="share_product_action" name="Share type" id="menu_easy_my_coop_share_product" parent="menu_easy_my_coop_main_subscription" sequence="20"/>
<!-- overriding product views to not display share product in the purchase and sale views--> <!-- overriding product views to not display share product in the purchase and sale views-->

9
easy_my_coop/view/res_company_view.xml

@ -21,6 +21,15 @@
<field name="default_lang_id"/> <field name="default_lang_id"/>
<field name="board_representative"/> <field name="board_representative"/>
<field name="signature_scan"/> <field name="signature_scan"/>
<field name="display_internal_rules_approval"/>
<field name="internal_rules_approval_required"/>
<field name="internal_rules_approval_text"/>
<field name="display_data_policy_approval"/>
<field name="data_policy_approval_required"/>
<field name="data_policy_approval_text"/>
<field name="display_financial_risk_approval"/>
<field name="financial_risk_approval_required"/>
<field name="financial_risk_approval_text"/>
</group> </group>
</xpath> </xpath>
</field> </field>

11
easy_my_coop/view/res_partner_view.xml

@ -19,8 +19,8 @@
<group> <group>
<field name="representative" attrs="{'invisible':['|',('parent_id','=',False),('is_company','=',True)]}"/> <field name="representative" attrs="{'invisible':['|',('parent_id','=',False),('is_company','=',True)]}"/>
<field name="cooperator_register_number" readonly="True" attrs="{'invisible':[('member','=',False)]}"/> <field name="cooperator_register_number" readonly="True" attrs="{'invisible':[('member','=',False)]}"/>
<field name="legal_form" attrs="{'invisible':[('is_company','=',False)]}"/>
<field name="company_register_number" readonly="True" attrs="{'invisible':[('is_company','=',False)]}"/> <field name="company_register_number" readonly="True" attrs="{'invisible':[('is_company','=',False)]}"/>
<field name="national_register_number" readonly="True" attrs="{'invisible':[('is_company','=',True)]}" groups="easy_my_coop.group_energiris_manager"/>
<field name="coop_candidate" groups="easy_my_coop.group_energiris_user"/> <field name="coop_candidate" groups="easy_my_coop.group_energiris_user"/>
<field name="cooperator" invisible="True" groups="easy_my_coop.group_energiris_super_manager"/> <field name="cooperator" invisible="True" groups="easy_my_coop.group_energiris_super_manager"/>
<field name="member" groups="easy_my_coop.group_energiris_super_manager"/> <field name="member" groups="easy_my_coop.group_energiris_super_manager"/>
@ -30,6 +30,11 @@
<group> <group>
<field name="gender" attrs="{'invisible':[('is_company','=',True)]}"/> <field name="gender" attrs="{'invisible':[('is_company','=',True)]}"/>
</group> </group>
<group name="approvals">
<field name="internal_rules_approved" />
<field name="data_policy_approved" />
<field name="financial_risk_approved" />
</group>
</xpath> </xpath>
<xpath expr="//page[@name='sales_purchases']" position='after'> <xpath expr="//page[@name='sales_purchases']" position='after'>
@ -91,7 +96,6 @@
</field> </field>
</record> </record>
<menuitem name="Cooperators" id="menu_easy_my_coop_main_coop" parent="menu_main_easy_my_coop" sequence="5" />
<record id="action_partner_cooperator_form" model="ir.actions.act_window"> <record id="action_partner_cooperator_form" model="ir.actions.act_window">
<field name="name">Cooperator</field> <field name="name">Cooperator</field>
@ -113,7 +117,6 @@
</field> </field>
</record> </record>
<menuitem id="menu_easy_my_coop_cooperator" name="Cooperators" parent="menu_easy_my_coop_main_coop" action="action_partner_cooperator_form" sequence="100"/>
<record id="action_partner_cooperator_candidate_form" model="ir.actions.act_window"> <record id="action_partner_cooperator_candidate_form" model="ir.actions.act_window">
<field name="name">Cooperator candidates</field> <field name="name">Cooperator candidates</field>
@ -135,7 +138,6 @@
</field> </field>
</record> </record>
<menuitem id="menu_easy_my_coop_cooperator_candidate" name="Cooperator Candidates" parent="menu_easy_my_coop_main_coop" action="action_partner_cooperator_candidate_form" sequence="150"/>
<record id="action_company_representative_form" model="ir.actions.act_window"> <record id="action_company_representative_form" model="ir.actions.act_window">
<field name="name">Company representative</field> <field name="name">Company representative</field>
@ -156,7 +158,6 @@
</field> </field>
</record> </record>
<menuitem id="menu_easy_my_coop_company_representative" name="Company representative" parent="menu_easy_my_coop_main_coop" action="action_company_representative_form" sequence="160"/>
<record id="remove_partner_follower" model="ir.ui.view"> <record id="remove_partner_follower" model="ir.ui.view">
<field name="name">res.partner.remove.follower.inherit</field> <field name="name">res.partner.remove.follower.inherit</field>

11
easy_my_coop/view/subscription_request_view.xml

@ -1,10 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<openerp> <openerp>
<data> <data>
<menuitem name="Easy-My Coop" id="menu_main_easy_my_coop" sequence="40" groups="easy_my_coop.group_energiris_user"/>
<menuitem name="Subscription" id="menu_easy_my_coop_main_subscription" parent="menu_main_easy_my_coop" sequence="10" groups="easy_my_coop.group_energiris_manager"/>
<menuitem name="Reporting" id="menu_easy_my_coop_main_reporting" parent="menu_main_easy_my_coop" sequence="40" groups="easy_my_coop.group_energiris_manager"/>
<record id="subscription_request_tree" model="ir.ui.view"> <record id="subscription_request_tree" model="ir.ui.view">
<field name="name">subscription.request.tree</field> <field name="name">subscription.request.tree</field>
<field name="model">subscription.request</field> <field name="model">subscription.request</field>
@ -58,7 +54,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"/>
@ -79,6 +74,9 @@
<field name="lang"/> <field name="lang"/>
<field name="validated"/> <field name="validated"/>
<field name="skip_control_ng"/> <field name="skip_control_ng"/>
<field name="internal_rules_approved"/>
<field name="data_policy_approved"/>
<field name="financial_risk_approved"/>
</group> </group>
</group> </group>
<notebook> <notebook>
@ -131,7 +129,6 @@
<field name="search_view_id" ref="view_subscription_request_filter"/> <field name="search_view_id" ref="view_subscription_request_filter"/>
</record> </record>
<menuitem action="subscription_request_action" name="Cooperator Subscription" id="menu_easy_my_coop_subscription_request" parent="menu_easy_my_coop_main_subscription" sequence="10"/>
<record id="company_subscription_request_tree" model="ir.ui.view"> <record id="company_subscription_request_tree" model="ir.ui.view">
<field name="name">subscription.request.tree</field> <field name="name">subscription.request.tree</field>
@ -168,7 +165,6 @@
<field name="search_view_id" ref="view_subscription_request_filter"/> <field name="search_view_id" ref="view_subscription_request_filter"/>
</record> </record>
<menuitem action="company_subscription_request_action" name="Company Subscription" id="menu_easy_my_coop_company_subscription_request" parent="menu_easy_my_coop_main_subscription" sequence="12"/>
<record id="share_line_form" model="ir.ui.view"> <record id="share_line_form" model="ir.ui.view">
<field name="name">share.line.form</field> <field name="name">share.line.form</field>
@ -236,6 +232,5 @@
<field name="view_type">form</field> <field name="view_type">form</field>
</record> </record>
<menuitem action="share_line_action" name="Share lines" id="menu_easy_my_coop_share_line" parent="menu_easy_my_coop_main_subscription" sequence="20" groups="group_energiris_super_manager"/>
</data> </data>
</openerp> </openerp>

263
easy_my_coop/view/subscription_template.xml

@ -54,7 +54,7 @@
<h2 class="energie">Become Cooperator</h2><br/> <h2 class="energie">Become Cooperator</h2><br/>
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
<form action="/subscription/subscribe_share" method="post" class="form-horizontal mt32" enctype="multipart/form-data">
<form method="post" class="form-horizontal mt32" enctype="multipart/form-data">
<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()"/>
@ -70,37 +70,53 @@
</label> </label>
</div> </div>
<div t-attf-class="form-group">
<label>
<input type="checkbox" t-att-value="already_cooperator" name="already_cooperator" />
<div t-attf-class="form-group" style="display: none;">
Already cooperator? Already cooperator?
</label>
<input type="checkbox"
name="already_cooperator"
t-att-checked="already_cooperator"/>
</div> </div>
<div name="email_from_container" t-attf-class="form-group #{error and 'email_from' in error and 'has-error' or ''}">
<div name="email_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 t-if="not logged" name="confirm_email_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="confirm_email">Confirm Email</label>
<div class="col-md-7 col-sm-8 bottom-line" style="padding-bottom:20px">
<input type="confirm_email" class="form-control mandatory-field" name="confirm_email"
required="required" t-att-readonly="logged"
t-attf-value="#{confirm_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>
@ -108,30 +124,28 @@
</select> </select>
</div> </div>
<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 ''}" t-att-style="'display: none;' if logged else None">
<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-att-readonly="logged"
t-attf-value="#{birthdate or ''}" placeholder="05/03/1978"/>
</div> </div>
</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"/>
</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 ''}" t-att-style="'display: none;' if logged else None">
<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 +158,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 +170,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 +187,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 +199,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>
@ -219,7 +242,7 @@
<td width="20%"> <td width="20%">
<div style="margin-top:12px" t-attf-class="form-group #{error and 'total_parts' in error and 'has-error' or ''}"> <div style="margin-top:12px" t-attf-class="form-group #{error and 'total_parts' in error and 'has-error' or ''}">
<div> <div>
<input type="text" class="form-control total" name="total_parts" value="25" data-max="5000"
<input type="text" class="form-control total" name="total_parts" value="25" t-att-data-max="company.subscription_maximum_amount"
t-att-readonly="'readonly'" t-att-readonly="'readonly'"
/> />
</div> </div>
@ -240,6 +263,51 @@
<br/> <br/>
<div id="internal_rules_approved" t-if="display_internal_rules" t-attf-class="form-group" >
<label class="col-md-3 col-sm-4 control-label" for="internal_rules_approved">Internal Rules</label>
<div class="col-md-9 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox"
name="internal_rules_approved"
t-att-required="internal_rules_required"
t-att-checked="internal_rules_approved"/>
<t t-raw="internal_rules_text"/>
</label>
</div>
</div>
</div>
<div id="data_policy_approved" t-if="display_data_policy" 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-9 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox"
name="data_policy_approved"
t-att-required="data_policy_required"
t-att-checked="data_policy_approved"/>
<t t-raw="data_policy_text"/>
</label>
</div>
</div>
</div>
<div id="financial_risk_approved" t-if="display_financial_risk" t-attf-class="form-group" >
<label class="col-md-3 col-sm-4 control-label" for="financial_risk_approved">Financial Risk</label>
<div class="col-md-9 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox"
name="financial_risk_approved"
t-att-required="financial_risk_required"
t-att-checked="financial_risk_approved"/>
<t t-raw="financial_risk_text"/>
</label>
</div>
</div>
</div>
<table style="margin-left:195px"> <table style="margin-left:195px">
<tr> <tr>
<td width="80%"> <td width="80%">
@ -273,7 +341,7 @@
<h2 class="energie">Become Cooperator</h2><br/> <h2 class="energie">Become Cooperator</h2><br/>
<div class="row"> <div class="row">
<div class="col-md-8"> <div class="col-md-8">
<form action="/subscription/subscribe_share" method="post" class="form-horizontal mt32" enctype="multipart/form-data">
<form method="post" class="form-horizontal mt32" enctype="multipart/form-data">
<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()"/>
@ -285,6 +353,12 @@
<label> <label>
<input type="checkbox" t-att-value="is_company" checked="checked" name="is_company" /> <input type="checkbox" t-att-value="is_company" checked="checked" name="is_company" />
Is a company? Is a company?
</label>
<label>
Already cooperator?
<input type="checkbox"
name="already_cooperator"
t-att-checked="already_cooperator"/>
</label> </label>
</div> </div>
@ -297,20 +371,25 @@
<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-att-readonly="logged"
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-att-readonly="logged"
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" t-att-readonly="logged" 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>
@ -321,14 +400,26 @@
<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-att-readonly="logged"
t-attf-value="#{company_email or ''}" placeholder="administration@beescoop.be"/>
</div> </div>
</div> </div>
<div 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="confirm_email">Confirm Email</label>
<div class="col-md-7 col-sm-8 bottom-line" style="padding-bottom:20px">
<input type="confirm_email" class="form-control mandatory-field" name="confirm_email"
required="required" t-att-readonly="logged"
t-attf-value="#{confirm_email or ''}" placeholder="didier.bourdon@bees-coop.be"/>
</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>
@ -342,7 +433,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>
@ -352,11 +445,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>
@ -366,7 +463,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>
@ -383,20 +481,25 @@
<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-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="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-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="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" 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>
@ -407,42 +510,44 @@
<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 '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>
<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-att-readonly="logged"
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-att-readonly="logged"
t-attf-value="#{birthdate or ''}" placeholder="05/03/1978"/>
</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>
@ -455,7 +560,8 @@
<div t-attf-class="form-group #{error and 'product_id' in error and 'has-error' or ''}"> <div t-attf-class="form-group #{error and 'product_id' in error and 'has-error' or ''}">
<label class="col-md-3 col-sm-4 control-label" style="width:25%" for="share_product_id">Parts type</label> <label class="col-md-3 col-sm-4 control-label" style="width:25%" for="share_product_id">Parts type</label>
<select id="share_product_id" name="share_product_id" class="col-md-7 col-sm-8 form-control " style="width:54%;margin-left:15px">
<select id="share_product_id" name="share_product_id" class="col-md-7 col-sm-8 form-control "
t-att-readonly="logged" style="width:54%;margin-left:15px">
<t t-foreach="products or []" t-as="product"> <t t-foreach="products or []" t-as="product">
<option t-att-value="product.id" t-att-selected="product.id == int(share_product_id)"><t t-esc="product.short_name"/></option> <option t-att-value="product.id" t-att-selected="product.id == int(share_product_id)"><t t-esc="product.short_name"/></option>
</t> </t>
@ -502,6 +608,53 @@
<br/> <br/>
<div id="internal_rules_approved" t-if="display_internal_rules" t-attf-class="form-group" >
<label class="col-md-3 col-sm-4 control-label" for="internal_rules_approved">Internal Rules</label>
<div class="col-md-9 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox"
name="internal_rules_approved"
t-att-required="internal_rules_required"
t-att-checked="internal_rules_approved"/>
<t t-raw="internal_rules_text"/>
</label>
</div>
</div>
</div>
<div id="data_policy_approved" t-if="display_data_policy" 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-9 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox"
name="data_policy_approved"
t-att-required="data_policy_required"
t-att-checked="data_policy_approved"/>
<t t-raw="data_policy_text"/>
</label>
</div>
</div>
</div>
<div id="financial_risk_approved" t-if="display_financial_risk" t-attf-class="form-group" >
<label class="col-md-3 col-sm-4 control-label" for="financial_risk_approved">Financial Risk</label>
<div class="col-md-9 col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox"
name="financial_risk_approved"
t-att-required="financial_risk_required"
t-att-checked="financial_risk_approved"/>
<t t-raw="financial_risk_text"/>
</label>
</div>
</div>
</div>
<div t-attf-class="form-group" >
<div class="col-md-7 col-sm-8">
<table style="margin-left:195px"> <table style="margin-left:195px">
<tr> <tr>
<td width="80%"> <td width="80%">
@ -516,6 +669,8 @@
</td> </td>
</tr> </tr>
</table> </table>
</div>
</div>
<br/> <br/>
</form> </form>

41
easy_my_coop/wizard/cooperative_history_wizard.xml

@ -1,41 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<record id="view_cooperative_history_wizard" model="ir.ui.view">
<field name="name">cooperative.history.wizard.form</field>
<field name="model">cooperative.history.report</field>
<field name="arch" type="xml">
<form string="Reporting" version="7.0">
<separator string="Cooperative History"/>
<group>
<field name="report"/>
</group>
<label string="This report allows you to print a pdf of history and number of share for each cooperator"/>
<group>
<field name="display_cooperator"/>
</group>
<footer>
<button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="action_cooperative_history_wizard" model="ir.actions.act_window">
<field name="name">Cooperative history</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">cooperative.history.report</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_cooperative_history_wizard"/>
<field name="target">new</field>
<field name="multi">True</field>
</record>
<menuitem id="menu_energiris_reporting" name="Reporting" parent="menu_main_energiris" sequence="20"/>
<menuitem id="menu_coop_history_wizard_report" name="Cooperative history report" parent="menu_energiris_reporting" action="action_cooperative_history_wizard" sequence="10"/>
</data>
</openerp>

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"/>

52
easy_my_coop/wizard/update_partner_info.py

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from openerp import api, fields, models, _
from openerp.exceptions import UserError
from openerp import api, fields, models
class PartnerUpdateInfo(models.TransientModel): class PartnerUpdateInfo(models.TransientModel):
@ -18,35 +17,54 @@ class PartnerUpdateInfo(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
register_number = fields.Char(string="Register Number", register_number = fields.Char(string="Register Number",
required=True,
default=_get_register_number) default=_get_register_number)
cooperator = fields.Many2one('res.partner', cooperator = fields.Many2one('res.partner',
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."))
all = fields.Boolean(string="Update from subscription request")
birthdate = fields.Boolean(string="set missing birth date")
legal_form = fields.Boolean(string="Set legal form")
representative_function = fields.Boolean(string="Set function")
@api.multi @api.multi
def update(self): def update(self):
partner_obj = self.env['res.partner']
cooperator = self.cooperator cooperator = self.cooperator
coop_vals = {} coop_vals = {}
if self.all:
if self.legal_form or self.representative_function:
coops = partner_obj.search([('cooperator', '=', True),
('is_company', '=', True)])
for coop in coops:
coop_vals = {}
sub_reqs = coop.subscription_request_ids.filtered(lambda r: r.state in ['done', 'paid'])
if sub_reqs:
sub_req = sub_reqs[0]
if self.legal_form:
coop_vals['legal_form'] = sub_req.company_type
coop.write(coop_vals)
if self.representative_function:
contact = coop.get_representative()
contact.function = sub_req.contact_person_function
else:
coops = partner_obj.search([('cooperator', '=', True),
('birthdate_date', '=', False),
('is_company', '=', False)])
for coop in coops:
coop_vals = {}
sub_reqs = coop.subscription_request_ids.filtered(lambda r: r.state in ['done', 'paid'])
if sub_reqs:
sub_req = sub_reqs[0]
if self.birthdate:
coop_vals['birthdate_date'] = sub_req.birthdate
coop.write(coop_vals)
else:
if cooperator:
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)

7
easy_my_coop/wizard/update_partner_info.xml

@ -10,8 +10,12 @@
Update Cooperator Info. Update Cooperator Info.
</p> </p>
<group> <group>
<field name="all"/>
<field name="birthdate"/>
<field name="legal_form"/>
<field name="representative_function"/>
<field name="cooperator" readonly="True"/> <field name="cooperator" readonly="True"/>
<field name="register_number"/>
<field name="register_number" attrs="{'required':[('all', '=', False)]}"/>
</group> </group>
<footer> <footer>
<button name="update" string="Update Info" type="object" class="btn-primary"/> <button name="update" string="Update Info" type="object" class="btn-primary"/>
@ -30,6 +34,5 @@
<field name="target">new</field> <field name="target">new</field>
<field name="groups_id" eval="[(4,ref('easy_my_coop.group_energiris_manager'))]"/> <field name="groups_id" eval="[(4,ref('easy_my_coop.group_energiris_manager'))]"/>
</record> </record>
</data> </data>
</openerp> </openerp>

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_be/__init__.py

@ -0,0 +1 @@
from . import models

2
easy_my_coop_be/models/__init__.py

@ -0,0 +1,2 @@
from . import coop
from . import partner

11
easy_my_coop_be/models/coop.py

@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
from openerp import fields, models
class SubscriptionRequest(models.Model):
_inherit = 'subscription.request'
company_type = fields.Selection([('scrl', 'SCRL'),
('asbl', 'ASBL'),
('sprl', 'SPRL'),
('sa', 'SA')])

11
easy_my_coop_be/models/partner.py

@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
from openerp import fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
legal_form = fields.Selection(selection_add=[('scrl', 'SCRL'),
('asbl', 'ASBL'),
('sprl', 'SPRL'),
('sa', 'SA')])

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,
} }

1
easy_my_coop_ch/models/__init__.py

@ -1 +1,2 @@
from . import coop from . import coop
from . import partner

17
easy_my_coop_ch/models/coop.py

@ -5,22 +5,25 @@ from openerp import fields, models
class subscription_request(models.Model): class subscription_request(models.Model):
_inherit = 'subscription.request' _inherit = 'subscription.request'
company_type = fields.Selection([('ei', 'Individual company'),
company_type = fields.Selection(selection_add=[
('ei', 'Individual company'),
('snc', 'Partnership'), ('snc', 'Partnership'),
('sa', 'Limited company (SA)'), ('sa', 'Limited company (SA)'),
('sarl', 'Limited liability company (Ltd)'), #noqa
('sarl', 'Limited liability company (Ltd)'),
('sc', 'Cooperative'), ('sc', 'Cooperative'),
('asso', 'Association'), ('asso', 'Association'),
('fond', 'Foundation'), ('fond', 'Foundation'),
('edp', 'Company under public law')])
('edp', 'Company under public law')
])
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:
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
def check_iban(self, iban):
if iban:
return super(subscription_request, self).check_iban(iban)
return True return True

17
easy_my_coop_ch/models/partner.py

@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from openerp import fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
legal_form = fields.Selection(selection_add=[
('ei', 'Individual company'),
('snc', 'Partnership'),
('sa', 'Limited company (SA)'),
('sarl', 'Limited liability company (Ltd)'),
('sc', 'Cooperative'),
('asso', 'Association'),
('fond', 'Foundation'),
('edp', 'Company under public law')
])

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>

18
easy_my_coop_ch/views/subscription_template.xml

@ -2,11 +2,25 @@
<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">
<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>
<div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="iban" t-attf-value="#{iban or ''}" placeholder="BE48523080767127"/>
</div>
</div>
</xpath>
</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">
<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>
<div class="col-md-7 col-sm-8">
<input type="text" class="form-control mandatory-field" name="iban" t-attf-value="#{iban or ''}" placeholder="BE48523080767127"/>
</div>
</div>
</xpath>
</template> </template>
</data> </data>
</odoo> </odoo>

14
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',
@ -22,8 +21,6 @@ HEADER = [
'Pays', 'Pays',
'Nombre de part total', 'Nombre de part total',
'Montant total des parts', 'Montant total des parts',
# 'Numero de demande',
# 'Statut',
'Demande de liberation de capital', 'Demande de liberation de capital',
'Communication', 'Communication',
'Nombre de part', 'Nombre de part',
@ -38,7 +35,6 @@ HEADER2 = [
'Nombre de part', 'Nombre de part',
'Montant', 'Montant',
'Statut', 'Statut',
'Numero de registre national',
'Email', 'Email',
'Mobile', 'Mobile',
'Adresse', 'Adresse',
@ -79,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)
@ -126,8 +120,8 @@ class export_global_report(models.TransientModel):
i += 1 i += 1
worksheet1.write(j, i, line.price_subtotal) worksheet1.write(j, i, line.price_subtotal)
i += 1 i += 1
if invoice.payment_ids:
worksheet1.write(j, i, invoice.payment_ids[0].date)
if invoice.payment_move_line_ids:
worksheet1.write(j, i, invoice.payment_move_line_ids[0].date)
i += 1 i += 1
if invoice.subscription_request: if invoice.subscription_request:
ind = len(invoice.subscription_request)-1 ind = len(invoice.subscription_request)-1
@ -225,7 +219,7 @@ class export_global_report(models.TransientModel):
amount = quantity * sub_request.share_unit_price amount = quantity * sub_request.share_unit_price
worksheet1bis.write(j, i, amount) worksheet1bis.write(j, i, amount)
i += 2 i += 2
worksheet1bis.write(j, i, sub_request.sync_date)
worksheet1bis.write(j, i, sub_request.date)
j += 1 j += 1
worksheet2 = workbook.add_worksheet() worksheet2 = workbook.add_worksheet()
@ -252,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)

1
easy_my_coop_fr/models/__init__.py

@ -1 +1,2 @@
from . import coop from . import coop
from . import partner

10
easy_my_coop_fr/models/coop.py

@ -5,11 +5,12 @@ from openerp import fields, models
class SubscriptionRequest(models.Model): class SubscriptionRequest(models.Model):
_inherit = 'subscription.request' _inherit = 'subscription.request'
company_type = fields.Selection([
company_type = fields.Selection(selection_add=[
('asso', 'Association'), ('asso', 'Association'),
('eurl', 'EURL / Entreprise individuelle'), ('eurl', 'EURL / Entreprise individuelle'),
('sarl', 'SARL'), ('sarl', 'SARL'),
('sa', 'SA / SAS')])
('sa', 'SA / SAS')
])
def get_required_field(self): def get_required_field(self):
req_fields = super(SubscriptionRequest, self).get_required_field() req_fields = super(SubscriptionRequest, self).get_required_field()
@ -17,8 +18,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

13
easy_my_coop_fr/models/partner.py

@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
from openerp import fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
legal_form = fields.Selection(selection_add=[
('asso', 'Association'),
('eurl', 'EURL / Entreprise individuelle'),
('sarl', 'SARL'),
('sa', 'SA / SAS')
])

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>

1
easy_my_coop_online_payment/controllers/main.py

@ -47,7 +47,6 @@ class SubscriptionWebsitePayment(website_payment):
'amount': float(amount), 'amount': float(amount),
'currency_id': int(currency_id), 'currency_id': int(currency_id),
'partner_id': partner_id, 'partner_id': partner_id,
'release_capital_request': capital_release_request.id,
} }
if len(capital_release_request) > 0: if len(capital_release_request) > 0:

2
easy_my_coop_website_document/__openerp__.py

@ -15,7 +15,7 @@
'author': 'Rémy Taymans', 'author': 'Rémy Taymans',
'license': 'AGPL-3', 'license': 'AGPL-3',
'version': '9.0.1.0', 'version': '9.0.1.0',
'website': "https://github.com/houssine78/vertical-cooperative",
'website': "www.coopiteasy.be",
'category': 'Website, Cooperative Management', 'category': 'Website, Cooperative Management',

2
easy_my_coop_website_portal/__openerp__.py

@ -15,7 +15,7 @@
'author': 'Rémy Taymans', 'author': 'Rémy Taymans',
'license': 'AGPL-3', 'license': 'AGPL-3',
'version': '9.0.1.0', 'version': '9.0.1.0',
'website': "https://github.com/houssine78/vertical-cooperative",
'website': "www.coopiteasy.be",
'category': 'Website, Cooperative Management', 'category': 'Website, Cooperative Management',

2
easy_my_coop_website_taxshelter/__openerp__.py

@ -15,7 +15,7 @@
'author': 'Rémy Taymans', 'author': 'Rémy Taymans',
'license': 'AGPL-3', 'license': 'AGPL-3',
'version': '9.0.1.0', 'version': '9.0.1.0',
'website': "https://github.com/houssine78/vertical-cooperative",
'website': "www.coopiteasy.be",
'category': 'Website, Cooperative Management', 'category': 'Website, Cooperative Management',

2
website_portal_extend/__openerp__.py

@ -16,7 +16,7 @@
'author': 'Rémy Taymans', 'author': 'Rémy Taymans',
'license': 'AGPL-3', 'license': 'AGPL-3',
'version': '9.0.1.0', 'version': '9.0.1.0',
'website': "https://github.com/houssine78/vertical-cooperative",
'website': "www.coopiteasy.be",
'category': 'Website', 'category': 'Website',

Loading…
Cancel
Save