diff --git a/easy_my_coop/__openerp__.py b/easy_my_coop/__openerp__.py
index 82ecf05..f14367f 100644
--- a/easy_my_coop/__openerp__.py
+++ b/easy_my_coop/__openerp__.py
@@ -21,8 +21,8 @@
{
"name": "Easy My Coop",
"version": "1.1",
- "depends": ["base",
- "sale",
+ "depends": ["base",
+ "sale",
"purchase",
"account_accountant",
"product",
@@ -40,7 +40,8 @@
"website": "www.coopiteasy.be",
"license": "AGPL-3",
"description": """
- This module allows to manage the cooperator subscription and all the cooperative business processes.
+ This module allows to manage the cooperator subscription and all the
+ cooperative business processes.
""",
'data': [
'security/easy_my_coop_security.xml',
@@ -48,7 +49,7 @@
'wizard/create_subscription_from_partner.xml',
'wizard/update_partner_info.xml',
'view/subscription_request_view.xml',
- 'view/email_template_view.xml',
+ 'view/email_template_view.xml',
'view/res_partner_view.xml',
'view/cooperator_register_view.xml',
'view/operation_request_view.xml',
@@ -57,15 +58,14 @@
'view/product_view.xml',
'view/res_company_view.xml',
'view/account_journal_view.xml',
- 'data/easy_my_coop_data.xml',
+ 'data/easy_my_coop_data.xml',
'report/easy_my_coop_report.xml',
'report/cooperator_invoice_G002.xml',
'report/cooperator_certificat_G001.xml',
'report/cooperator_subscription_G001.xml',
'report/cooperator_register_G001.xml',
'data/mail_template_data.xml',
- #'wizard/cooperative_history_wizard.xml',
],
'installable': True,
'application': True,
-}
\ No newline at end of file
+}
diff --git a/easy_my_coop/models/__init__.py b/easy_my_coop/models/__init__.py
index 0f4294a..9f09fa5 100644
--- a/easy_my_coop/models/__init__.py
+++ b/easy_my_coop/models/__init__.py
@@ -6,4 +6,3 @@ from . import account_invoice
from . import company
from . import res_partner_bank
from . import account_journal
-#import mail_mail
\ No newline at end of file
diff --git a/easy_my_coop/models/account_invoice.py b/easy_my_coop/models/account_invoice.py
index 3b15c39..cba3b20 100644
--- a/easy_my_coop/models/account_invoice.py
+++ b/easy_my_coop/models/account_invoice.py
@@ -1,17 +1,23 @@
# -*- coding: utf-8 -*-
from datetime import datetime
-from openerp import api, fields, models, _
+from openerp import api, fields, models
+
class account_invoice(models.Model):
_inherit = 'account.invoice'
- subscription_request = fields.Many2one('subscription.request', string='Subscription request')
- release_capital_request = fields.Boolean(string='Release of capital request')
+ subscription_request = fields.Many2one('subscription.request',
+ string='Subscription request')
+ release_capital_request = fields.Boolean(
+ string='Release of capital request')
@api.model
- def _prepare_refund(self, invoice, date_invoice=None, date=None, description=None, journal_id=None):
- values = super(account_invoice, self)._prepare_refund(invoice, date_invoice, date, description, journal_id)
+ def _prepare_refund(self, invoice, date_invoice=None, date=None,
+ description=None, journal_id=None):
+ values = super(account_invoice, self)._prepare_refund(
+ invoice, date_invoice, date,
+ description, journal_id)
values['release_capital_request'] = self.release_capital_request
return values
@@ -23,33 +29,33 @@ class account_invoice(models.Model):
mail_template_name = 'Payment Received Confirmation - Send By Email'
# if not yet cooperator we generate a cooperator number
- if self.partner_id.member == False and self.partner_id.old_member == False:
- sequence_id = obj_sequence.search([('name','=','Subscription Register')])[0]
+ if self.partner_id.member is False and self.partner_id.old_member is False:
+ sequence_id = obj_sequence.search([('name', '=', 'Subscription Register')])[0]
sub_reg_num = sequence_id.next_by_id()
- self.partner_id.write({'member':True,'old_member':False,
- 'cooperator_register_number':int(sub_reg_num)})
- elif self.partner_id.old_member == True:
- self.partner_id.write({'member':True,'old_member':False})
+ self.partner_id.write({'member': True, 'old_member': False,
+ 'cooperator_register_number': int(sub_reg_num)})
+ elif self.partner_id.old_member:
+ self.partner_id.write({'member': True, 'old_member': False})
else:
mail_template_name = 'Share Increase - Payment Received Confirmation - Send By Email'
- sequence_operation = obj_sequence.search([('name','=','Register Operation')])[0]
+ sequence_operation = obj_sequence.search([('name', '=', 'Register Operation')])[0]
sub_reg_operation = sequence_operation.next_by_id()
for line in self.invoice_line_ids:
sub_reg = self.env['subscription.register'].create(
- {'name':sub_reg_operation,
- 'register_number_operation':int(sub_reg_operation),
- 'partner_id':self.partner_id.id,
- 'quantity':line.quantity,
- 'share_product_id':line.product_id.id,
- 'share_unit_price':line.price_unit,
- 'date':effective_date,
- 'type':'subscription'})
- self.env['share.line'].create({'share_number':line.quantity,
- 'share_product_id':line.product_id.id,
- 'partner_id':self.partner_id.id,
- 'share_unit_price':line.price_unit,
- 'effective_date':effective_date})
+ {'name': sub_reg_operation,
+ 'register_number_operation': int(sub_reg_operation),
+ 'partner_id': self.partner_id.id,
+ 'quantity': line.quantity,
+ 'share_product_id': line.product_id.id,
+ 'share_unit_price': line.price_unit,
+ 'date': effective_date,
+ 'type': 'subscription'})
+ self.env['share.line'].create({'share_number': line.quantity,
+ 'share_product_id': line.product_id.id,
+ 'partner_id': self.partner_id.id,
+ 'share_unit_price': line.price_unit,
+ 'effective_date': effective_date})
email_template_obj = self.env['mail.template']
certificat_email_template = email_template_obj.search([('name', '=', mail_template_name)])[0]
@@ -59,22 +65,23 @@ class account_invoice(models.Model):
return True
def post_process_confirm_paid(self, effective_date):
- self.set_cooperator_effective(effective_date)
+ self.set_cooperator_effective(effective_date)
return True
- @api.multi
+ @api.multi
def confirm_paid(self):
for invoice in self:
super(account_invoice, invoice).confirm_paid()
# we check if there is an open refund for this invoice. in this case we
# don't run the process_subscription function as the invoice has been
# reconciled with a refund and not a payment.
- refund = self.search([('type','=','out_refund'),('origin','=',invoice.number)]).filtered(lambda record: record.state == 'open')
+ refund = self.search([('type', '=', 'out_refund'), ('origin', '=', invoice.number)]).filtered(lambda record: record.state == 'open')
if invoice.partner_id.cooperator and invoice.release_capital_request \
and invoice.type == 'out_invoice' and not refund:
- #take the effective date from the payment. by default the confirmation date is the payment date
+ # take the effective date from the payment.
+ # by default the confirmation date is the payment date
effective_date = datetime.now().strftime("%d/%m/%Y")
if invoice.payment_move_line_ids:
diff --git a/easy_my_coop/models/belgian_identification_id_generator.py b/easy_my_coop/models/belgian_identification_id_generator.py
index 05d8671..774320b 100644
--- a/easy_my_coop/models/belgian_identification_id_generator.py
+++ b/easy_my_coop/models/belgian_identification_id_generator.py
@@ -1,16 +1,18 @@
-from random import randrange,randint
-from datetime import date,timedelta
+from random import randrange, randint
+from datetime import date, timedelta
+
def random_date(start, end):
delta = end - start
return start + timedelta(seconds=randrange(delta.total_seconds()))
-
+
+
def generate_identification_id(start_date, end_date):
birthday = random_date(start_date, end_date)
year = str(birthday.year)[2:]
month = str(birthday.month).zfill(2)
day = str(birthday.day).zfill(2)
- gender = str(randint(1,998)).zfill(3)
+ gender = str(randint(1, 998)).zfill(3)
millenium_baby = birthday.year > 2000
main_number = year + month + day + gender
@@ -19,13 +21,15 @@ def generate_identification_id(start_date, end_date):
control_number = str(control_number).zfill(2)
return main_number + control_number
-
+
+
def identification_id_to_gender(identification_id):
if identification_id and len(identification_id) == 11:
gender = identification_id[6:9]
- return int(gender)%2
+ return int(gender) % 2
+
-identification_id = generate_identification_id(date(1920,1,1), date(1995,12,31))
-gender = identification_id_to_gender(identification_id)
-print 'Rijksregisternummer: ' + identification_id
-print 'Geslacht: ' + ('Man' if gender else 'Vrouw')
+INDENTITY_ID = generate_identification_id(date(1920, 1, 1), date(1995, 12, 31))
+GENDER = identification_id_to_gender(INDENTITY_ID)
+print 'Rijksregisternummer: ' + INDENTITY_ID
+print 'Geslacht: ' + ('Man' if GENDER else 'Vrouw')
diff --git a/easy_my_coop/wizard/cooperative_history_wizard.xml b/easy_my_coop/wizard/cooperative_history_wizard.xml
index e800ce9..7fd2d33 100644
--- a/easy_my_coop/wizard/cooperative_history_wizard.xml
+++ b/easy_my_coop/wizard/cooperative_history_wizard.xml
@@ -1,7 +1,6 @@
-
cooperative.history.wizard.form
cooperative.history.report
@@ -14,7 +13,6 @@
-
-
-
diff --git a/easy_my_coop_be/__openerp__.py b/easy_my_coop_be/__openerp__.py
index 1f6789e..f1e90f2 100644
--- a/easy_my_coop_be/__openerp__.py
+++ b/easy_my_coop_be/__openerp__.py
@@ -22,16 +22,16 @@
"name": "Easy My Coop Be",
"version": "1.0",
"depends": ["easy_my_coop",
- "l10n_be",
+ "l10n_be",
"l10n_be_invoice_bba",
],
"author": "Houssine BAKKALI ",
"category": "Cooperative management",
"website": "www.coopiteasy.be",
"description": """
- This is the belgian localization for the easy my coop module.
+ This is the belgian localization for the easy my coop module.
""",
'data': [],
'installable': True,
'application': False,
-}
\ No newline at end of file
+}
diff --git a/easy_my_coop_ch/__openerp__.py b/easy_my_coop_ch/__openerp__.py
index b9bf0b4..0a8efef 100644
--- a/easy_my_coop_ch/__openerp__.py
+++ b/easy_my_coop_ch/__openerp__.py
@@ -23,16 +23,16 @@
"version": "1.0",
"depends": ["easy_my_coop",
"l10n_ch",
- "theme_light",],
+ "theme_light"],
"author": "Houssine BAKKALI ",
"category": "Cooperative management",
'webstite': "www.coopiteasy.be",
"description": """
- This is the swiss localization for the easy my coop module
+ This is the swiss localization for the easy my coop module
""",
'data': [
'views/subscription_template.xml',
'views/subscription_request_view.xml'
],
'installable': True,
-}
\ No newline at end of file
+}
diff --git a/easy_my_coop_document/__init__.py b/easy_my_coop_document/__init__.py
index 447df70..c204cef 100644
--- a/easy_my_coop_document/__init__.py
+++ b/easy_my_coop_document/__init__.py
@@ -1,2 +1,2 @@
# -*- coding: utf8 -*-
-import models
+from . import models
diff --git a/easy_my_coop_eater/__openerp__.py b/easy_my_coop_eater/__openerp__.py
index 50f3918..7c22295 100644
--- a/easy_my_coop_eater/__openerp__.py
+++ b/easy_my_coop_eater/__openerp__.py
@@ -21,15 +21,15 @@
{
"name": "Easy My Coop Eater/worker",
"version": "1.0",
- "depends": ["easy_my_coop","partner_age"],
+ "depends": ["easy_my_coop", "partner_age"],
"author": "Houssine BAKKALI ",
"category": "Cooperative management",
'website': "www.coopiteasy.be",
"description": """
- This module allows to manage the activity of the cooperator.
+ This module allows to manage the activity of the cooperator.
""",
'data': [
'view/product_view.xml',
],
'installable': True,
-}
\ No newline at end of file
+}
diff --git a/easy_my_coop_fr/__init__.py b/easy_my_coop_fr/__init__.py
index 9a7e03e..7f0969e 100644
--- a/easy_my_coop_fr/__init__.py
+++ b/easy_my_coop_fr/__init__.py
@@ -1 +1 @@
-from . import models
\ No newline at end of file
+from . import models
diff --git a/easy_my_coop_fr/__openerp__.py b/easy_my_coop_fr/__openerp__.py
index 8410d32..c479179 100644
--- a/easy_my_coop_fr/__openerp__.py
+++ b/easy_my_coop_fr/__openerp__.py
@@ -23,12 +23,12 @@
"version": "1.0",
"depends": ["easy_my_coop",
"l10n_fr",
- "theme_light",],
+ "theme_light"],
"author": "Houssine BAKKALI ",
"category": "Cooperative management",
'webstite': "www.coopiteasy.be",
"description": """
- This is the french localization for the easy my coop module
+ This is the french localization for the easy my coop module
""",
'data': [
'views/subscription_template.xml',
@@ -36,4 +36,4 @@
'views/certificate_template.xml'
],
'installable': True,
-}
\ No newline at end of file
+}
diff --git a/easy_my_coop_fr/models/__init__.py b/easy_my_coop_fr/models/__init__.py
index 0b75654..bb5197b 100644
--- a/easy_my_coop_fr/models/__init__.py
+++ b/easy_my_coop_fr/models/__init__.py
@@ -1 +1 @@
-from . import coop
\ No newline at end of file
+from . import coop
diff --git a/easy_my_coop_fr/models/coop.py b/easy_my_coop_fr/models/coop.py
index 70a0fc3..f1952c1 100644
--- a/easy_my_coop_fr/models/coop.py
+++ b/easy_my_coop_fr/models/coop.py
@@ -1,23 +1,25 @@
# -*- coding: utf-8 -*-
-from openerp import api, fields, models, _
+from openerp import fields, models
class subscription_request(models.Model):
_inherit = 'subscription.request'
-
- company_type = fields.Selection([('asso','Association'),
- ('eurl','EURL / Entreprise individuelle'),
- ('sarl','SARL'),
- ('sa','SA / SAS')])
-
+
+ company_type = fields.Selection([
+ ('asso', 'Association'),
+ ('eurl', 'EURL / Entreprise individuelle'),
+ ('sarl', 'SARL'),
+ ('sa', 'SA / SAS')])
+
def get_required_field(self):
- required_fields = super(subscription_request,self).get_required_field()
+ required_fields = super(subscription_request, self).get_required_field()
if 'iban' in required_fields:
required_fields.remove('iban')
-
+
return required_fields
-
+
+ # override function to disable the check
def check_belgian_identification_id(self, nat_register_num):
- #deactivate number validation for french localization
- return True
\ No newline at end of file
+ # deactivate number validation for french localization
+ return True
diff --git a/easy_my_coop_online_payment/__openerp__.py b/easy_my_coop_online_payment/__openerp__.py
index 2ac5d4d..557339c 100644
--- a/easy_my_coop_online_payment/__openerp__.py
+++ b/easy_my_coop_online_payment/__openerp__.py
@@ -22,14 +22,14 @@
"name": "Easy My Coop Online Payment",
"version": "1.0",
"depends": ["easy_my_coop",
- "website_payment",
+ "website_payment",
"payment_paypal"],
"author": "Houssine BAKKALI ",
"category": "Cooperative management",
'website': "www.coopiteasy.be",
"description": """
- This module allows the cooperator to pay the subscribed shares online
- during the subscription process
+ This module allows the cooperator to pay the subscribed shares online
+ during the subscription process
""",
'data': [
"views/online_payment_template.xml",
@@ -37,4 +37,4 @@
],
'installable': True,
'application': False,
-}
\ No newline at end of file
+}
diff --git a/easy_my_coop_recompute_coop_number/__init__.py b/easy_my_coop_recompute_coop_number/__init__.py
index 12cdf3c..dd1a660 100644
--- a/easy_my_coop_recompute_coop_number/__init__.py
+++ b/easy_my_coop_recompute_coop_number/__init__.py
@@ -1 +1 @@
-import wizard
\ No newline at end of file
+from . import wizard
diff --git a/easy_my_coop_recompute_coop_number/__openerp__.py b/easy_my_coop_recompute_coop_number/__openerp__.py
index 6b19e59..47dec52 100644
--- a/easy_my_coop_recompute_coop_number/__openerp__.py
+++ b/easy_my_coop_recompute_coop_number/__openerp__.py
@@ -26,11 +26,12 @@
"category": "Cooperative management",
'website': "www.coopiteasy.be",
"description": """
- This module allows to recompute the cooperator number subscription it has to be used carefully.
+ This module allows to recompute the cooperator number subscription
+ it has to be used carefully.
""",
'data': [
'wizard/cooperator_number_wizard.xml',
],
'installable': True,
'active': False,
-}
\ No newline at end of file
+}
diff --git a/easy_my_coop_recompute_coop_number/wizard/__init__.py b/easy_my_coop_recompute_coop_number/wizard/__init__.py
index 678a142..6b43157 100644
--- a/easy_my_coop_recompute_coop_number/wizard/__init__.py
+++ b/easy_my_coop_recompute_coop_number/wizard/__init__.py
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
-import cooperator_number_wizard
\ No newline at end of file
+from . import cooperator_number_wizard
diff --git a/easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.py b/easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.py
index ac537fd..dbb2ecb 100644
--- a/easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.py
+++ b/easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.py
@@ -3,17 +3,17 @@ from openerp import models, fields, api
class RecomputeWizard(models.TransientModel):
_name = 'register.number.wizard'
-
+
from_number = fields.Integer(string="From number")
to_number = fields.Integer(string="To number")
-
+
@api.one
def compute_register_number(self):
obj_sequence = self.env['ir.sequence']
sequence_operation = obj_sequence.search([('name','=','Register Operation')])[0]
- subscription_registers = self.env['subscription.register'].search([('register_number_operation','>=',self.from_number)])
+ subscription_registers = self.env['subscription.register'].search([('register_number_operation', '>=', self.from_number)])
for subscription_register in subscription_registers:
sub_reg_operation = sequence_operation.next_by_id()
-
- subscription_register.write({'name':sub_reg_operation,'register_number_operation':int(sub_reg_operation)})
+
+ subscription_register.write({'name':sub_reg_operation, 'register_number_operation': int(sub_reg_operation)})
diff --git a/easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.xml b/easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.xml
index 2e004aa..4083e10 100644
--- a/easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.xml
+++ b/easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.xml
@@ -1,25 +1,24 @@
-
Register number wizard
register.number.wizard
-
+
+
-
+
Recompute register number
ir.actions.act_window
register.number.wizard
diff --git a/easy_my_coop_taxshelter_report/__openerp__.py b/easy_my_coop_taxshelter_report/__openerp__.py
index ef944c5..fead4cc 100644
--- a/easy_my_coop_taxshelter_report/__openerp__.py
+++ b/easy_my_coop_taxshelter_report/__openerp__.py
@@ -27,7 +27,8 @@
'website': "www.coopiteasy.be",
"license": "AGPL-3",
"description": """
- This module allows to create a fiscal declaration year and to print tax shelter declaration each cooperator
+ This module allows to create a fiscal declaration year and to print
+ tax shelter declaration each cooperator
""",
'data': [
'security/ir.model.access.csv',
@@ -39,4 +40,4 @@
'data/scheduler_data.xml',
],
'installable': True,
-}
\ No newline at end of file
+}
diff --git a/easy_my_coop_website_document/__init__.py b/easy_my_coop_website_document/__init__.py
index 2fa08e5..35b969a 100644
--- a/easy_my_coop_website_document/__init__.py
+++ b/easy_my_coop_website_document/__init__.py
@@ -1,2 +1,2 @@
# -*- coding: utf8 -*-
-import controllers
+from . import controllers
diff --git a/easy_my_coop_website_document/controllers/main.py b/easy_my_coop_website_document/controllers/main.py
index 2d6a6c4..c4622e5 100644
--- a/easy_my_coop_website_document/controllers/main.py
+++ b/easy_my_coop_website_document/controllers/main.py
@@ -33,7 +33,7 @@ class DocumentWebsite(http.Controller):
elif status == 301:
# TODO: test this case not sure if this render the same
# return werkzeug.utils.redirect(content, code=301)
- return request.redirec(content, code=301)
+ return request.redirect(content, code=301)
elif status != 200:
return request.not_found()
content_base64 = base64.b64decode(content)
diff --git a/easy_my_coop_website_portal/__init__.py b/easy_my_coop_website_portal/__init__.py
index 2fa08e5..35b969a 100644
--- a/easy_my_coop_website_portal/__init__.py
+++ b/easy_my_coop_website_portal/__init__.py
@@ -1,2 +1,2 @@
# -*- coding: utf8 -*-
-import controllers
+from . import controllers
diff --git a/easy_my_coop_website_taxshelter/__init__.py b/easy_my_coop_website_taxshelter/__init__.py
index 2fa08e5..35b969a 100644
--- a/easy_my_coop_website_taxshelter/__init__.py
+++ b/easy_my_coop_website_taxshelter/__init__.py
@@ -1,2 +1,2 @@
# -*- coding: utf8 -*-
-import controllers
+from . import controllers
diff --git a/partner_age/__openerp__.py b/partner_age/__openerp__.py
index ab7fd0f..912b941 100644
--- a/partner_age/__openerp__.py
+++ b/partner_age/__openerp__.py
@@ -28,10 +28,10 @@
"category": "Cooperative management",
'website': "www.coopiteasy.be",
"description": """
- This module allows to recompute the cooperator number subscription it has to be used carefully.
+ This module computes the age of the partner.
""",
'data': [
'view/partner_view.xml',
],
'installable': True,
-}
\ No newline at end of file
+}