[FIX] Uncaught flake8 errors

This commit is contained in:
Pedro M. Baeza
2014-10-21 09:51:40 +02:00
committed by Enric Tobella
parent 074c85d9f3
commit f69f539953
3 changed files with 16 additions and 18 deletions

View File

@@ -31,7 +31,7 @@
'depends': ['account_banking_payment_export'],
'external_dependencies': {
'python': ['unidecode', 'lxml'],
},
},
'data': [
'views/payment_line_view.xml',
'views/payment_mode_view.xml',

View File

@@ -37,8 +37,8 @@ class BankingExportPain(orm.AbstractModel):
_name = 'banking.export.pain'
def _validate_iban(self, cr, uid, iban, context=None):
'''if IBAN is valid, returns IBAN
if IBAN is NOT valid, raises an error message'''
"""if IBAN is valid, returns IBAN
if IBAN is NOT valid, raises an error message"""
partner_bank_obj = self.pool.get('res.partner.bank')
if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context):
return iban.replace(' ', '')
@@ -162,7 +162,7 @@ class BankingExportPain(orm.AbstractModel):
'res_model': self._name,
'res_id': ids[0],
'target': 'new',
}
}
return action
def generate_group_header_block(
@@ -283,8 +283,8 @@ class BankingExportPain(orm.AbstractModel):
def generate_party_agent(
self, cr, uid, parent_node, party_type, party_type_label,
order, party_name, iban, bic, eval_ctx, gen_args, context=None):
'''Generate the piece of the XML file corresponding to BIC
This code is mutualized between TRF and DD'''
"""Generate the piece of the XML file corresponding to BIC
This code is mutualized between TRF and DD"""
assert order in ('B', 'C'), "Order can be 'B' or 'C'"
try:
bic = self._prepare_field(
@@ -324,8 +324,8 @@ class BankingExportPain(orm.AbstractModel):
def generate_party_block(
self, cr, uid, parent_node, party_type, order, name, iban, bic,
eval_ctx, gen_args, context=None):
'''Generate the piece of the XML file corresponding to Name+IBAN+BIC
This code is mutualized between TRF and DD'''
"""Generate the piece of the XML file corresponding to Name+IBAN+BIC
This code is mutualized between TRF and DD"""
assert order in ('B', 'C'), "Order can be 'B' or 'C'"
if party_type == 'Cdtr':
party_type_label = 'Creditor'
@@ -385,7 +385,7 @@ class BankingExportPain(orm.AbstractModel):
_('Error:'),
_("Missing 'Structured Communication Type' on payment "
"line with reference '%s'.")
% (line.name))
% line.name)
remittance_info_structured_2_100 = etree.SubElement(
remittance_info_2_91, 'Strd')
creditor_ref_information_2_120 = etree.SubElement(
@@ -425,9 +425,8 @@ class BankingExportPain(orm.AbstractModel):
def generate_creditor_scheme_identification(
self, cr, uid, parent_node, identification, identification_label,
eval_ctx, scheme_name_proprietary, gen_args, context=None):
csi_id = etree.SubElement(
parent_node, 'Id')
csi_privateid = csi_id = etree.SubElement(csi_id, 'PrvtId')
csi_id = etree.SubElement(parent_node, 'Id')
csi_privateid = etree.SubElement(csi_id, 'PrvtId')
csi_other = etree.SubElement(csi_privateid, 'Othr')
csi_other_id = etree.SubElement(csi_other, 'Id')
csi_other_id.text = self._prepare_field(

View File

@@ -23,19 +23,18 @@
from openerp.osv import orm, fields
class payment_line(orm.Model):
class PaymentLine(orm.Model):
_inherit = 'payment.line'
def _get_struct_communication_types(self, cr, uid, context=None):
return [('ISO', 'ISO')]
_columns = {
'priority': fields.selection([
('NORM', 'Normal'),
('HIGH', 'High'),
], 'Priority',
'priority': fields.selection(
[('NORM', 'Normal'),
('HIGH', 'High')], 'Priority',
help="This field will be used as the 'Instruction Priority' in "
"the generated PAIN file."),
"the generated PAIN file."),
# Update size from 64 to 140, because PAIN allows 140 caracters
'communication': fields.char(
'Communication', size=140, required=True,