Browse Source

[PEP8] fix pep8

pull/1/head
houssine 6 years ago
parent
commit
079d27f8d9
  1. 11
      easy_my_coop_fr/models/coop.py
  2. 12
      easy_my_coop_online_payment/models/coop.py
  3. 6
      easy_my_coop_online_payment/models/payment_transaction.py
  4. 7
      easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.py

11
easy_my_coop_fr/models/coop.py

@ -1,9 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from openerp import fields, models from openerp import fields, models
class subscription_request(models.Model):
class SubscriptionRequest(models.Model):
_inherit = 'subscription.request' _inherit = 'subscription.request'
company_type = fields.Selection([ company_type = fields.Selection([
@ -13,11 +12,11 @@ class subscription_request(models.Model):
('sa', 'SA / SAS')]) ('sa', 'SA / SAS')])
def get_required_field(self): def get_required_field(self):
required_fields = super(subscription_request, self).get_required_field()
if 'iban' in required_fields:
required_fields.remove('iban')
req_fields = super(SubscriptionRequest, self).get_required_field()
if 'iban' in req_fields:
req_fields.remove('iban')
return required_fields
return req_fields
# override function to disable the check # override function to disable the check
def check_belgian_identification_id(self, nat_register_num): def check_belgian_identification_id(self, nat_register_num):

12
easy_my_coop_online_payment/models/coop.py

@ -1,17 +1,21 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from openerp import api, fields, models, _
from openerp import fields, models
class SubscriptionRequest(models.Model): class SubscriptionRequest(models.Model):
_inherit = 'subscription.request' _inherit = 'subscription.request'
payment_type = fields.Selection([('online', 'Online'), payment_type = fields.Selection([('online', 'Online'),
('deferred', 'Deferred')], string='Payment Type', default="deferred")
('deferred', 'Deferred')],
string='Payment Type',
default="deferred")
def send_capital_release_request(self, invoice):
def send_capital_release_request(self, inv):
if self.payment_type == 'deferred': if self.payment_type == 'deferred':
super(SubscriptionRequest, self).send_capital_release_request(invoice)
super(SubscriptionRequest, self).send_capital_release_request(inv)
return True return True
class AccountInvoice(models.Model): class AccountInvoice(models.Model):
_inherit = 'account.invoice' _inherit = 'account.invoice'

6
easy_my_coop_online_payment/models/payment_transaction.py

@ -2,15 +2,17 @@
from datetime import datetime from datetime import datetime
import logging import logging
from openerp import api, fields, models, _
from openerp import api, fields, models
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
class PaymentTransaction(models.Model): class PaymentTransaction(models.Model):
_inherit = 'payment.transaction' _inherit = 'payment.transaction'
release_capital_request = fields.Many2one('account.invoice', string="Release Capital request")
release_capital_request = fields.Many2one('account.invoice',
string="Release Capital request")
@api.model @api.model
def process_online_payment_reception(self, tx): def process_online_payment_reception(self, tx):

7
easy_my_coop_recompute_coop_number/wizard/cooperator_number_wizard.py

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from openerp import models, fields, api from openerp import models, fields, api
class RecomputeWizard(models.TransientModel): class RecomputeWizard(models.TransientModel):
_name = 'register.number.wizard' _name = 'register.number.wizard'
@ -10,10 +11,12 @@ class RecomputeWizard(models.TransientModel):
@api.one @api.one
def compute_register_number(self): def compute_register_number(self):
obj_sequence = self.env['ir.sequence'] obj_sequence = self.env['ir.sequence']
sub_reg_obj = self.env['subscription.register']
sequence_operation = obj_sequence.search([('name', '=', 'Register Operation')])[0] sequence_operation = obj_sequence.search([('name', '=', 'Register Operation')])[0]
subscription_registers = self.env['subscription.register'].search([('register_number_operation', '>=', self.from_number)])
subscription_registers = sub_reg_obj.search([('register_number_operation', '>=', self.from_number)])
for subscription_register in subscription_registers: for subscription_register in subscription_registers:
sub_reg_operation = sequence_operation.next_by_id() 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)})
Loading…
Cancel
Save