mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[FIX] typo convertion/conversion in file_parser derived classes
This commit is contained in:
@@ -30,7 +30,7 @@ except:
|
|||||||
raise Exception(_('Please install python lib xlrd'))
|
raise Exception(_('Please install python lib xlrd'))
|
||||||
|
|
||||||
def float_or_zero(val):
|
def float_or_zero(val):
|
||||||
""" Convertion function used to manage
|
""" Conversion function used to manage
|
||||||
empty string into float usecase"""
|
empty string into float usecase"""
|
||||||
return val and float(val) or 0.0
|
return val and float(val) or 0.0
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ class GenericFileParser(FileParser):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, parse_name, ftype='csv'):
|
def __init__(self, parse_name, ftype='csv'):
|
||||||
convertion_dict = {
|
conversion_dict = {
|
||||||
'ref': unicode,
|
'ref': unicode,
|
||||||
'label': unicode,
|
'label': unicode,
|
||||||
'date': datetime.datetime,
|
'date': datetime.datetime,
|
||||||
@@ -52,7 +52,7 @@ class GenericFileParser(FileParser):
|
|||||||
}
|
}
|
||||||
# Order of cols does not matter but first row of the file has to be header
|
# Order of cols does not matter but first row of the file has to be header
|
||||||
keys_to_validate = ['ref', 'label', 'date', 'amount', 'commission_amount']
|
keys_to_validate = ['ref', 'label', 'date', 'amount', 'commission_amount']
|
||||||
super(GenericFileParser, self).__init__(parse_name, keys_to_validate=keys_to_validate, ftype=ftype, convertion_dict=convertion_dict)
|
super(GenericFileParser, self).__init__(parse_name, keys_to_validate=keys_to_validate, ftype=ftype, conversion_dict=conversion_dict)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def parser_for(cls, parser_name):
|
def parser_for(cls, parser_name):
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class TransactionIDFileParser(FileParser):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, parse_name, ftype='csv'):
|
def __init__(self, parse_name, ftype='csv'):
|
||||||
convertion_dict = {
|
conversion_dict = {
|
||||||
'transaction_id': unicode,
|
'transaction_id': unicode,
|
||||||
'label': unicode,
|
'label': unicode,
|
||||||
'date': datetime.datetime,
|
'date': datetime.datetime,
|
||||||
@@ -39,7 +39,8 @@ class TransactionIDFileParser(FileParser):
|
|||||||
}
|
}
|
||||||
# Order of cols does not matter but first row of the file has to be header
|
# Order of cols does not matter but first row of the file has to be header
|
||||||
keys_to_validate = ['transaction_id', 'label', 'date', 'amount', 'commission_amount']
|
keys_to_validate = ['transaction_id', 'label', 'date', 'amount', 'commission_amount']
|
||||||
super(TransactionIDFileParser, self).__init__(parse_name, keys_to_validate=keys_to_validate, ftype=ftype, convertion_dict=convertion_dict)
|
super(TransactionIDFileParser, self).__init__(parse_name, keys_to_validate=keys_to_validate,
|
||||||
|
ftype=ftype, conversion_dict=conversion_dict)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def parser_for(cls, parser_name):
|
def parser_for(cls, parser_name):
|
||||||
|
|||||||
Reference in New Issue
Block a user