add new method to the parser that can be used to provide statement info found in the parsed file

This commit is contained in:
Laurent Mignon (Acsone)
2014-01-14 16:50:19 +01:00
parent bc879326ed
commit e6bb1337c5
2 changed files with 11 additions and 1 deletions

View File

@@ -110,6 +110,14 @@ class BankStatementImportParser(object):
""" """
return NotImplementedError return NotImplementedError
def get_st_vals(self):
"""
This method return a dict of vals that ca be passed to
create method of statement.
:return: dict of vals that represent additional infos for the statement
"""
return {}
def get_st_line_vals(self, line, *args, **kwargs): def get_st_line_vals(self, line, *args, **kwargs):
""" """
Implement a method in your parser that must return a dict of vals that can be Implement a method in your parser that must return a dict of vals that can be

View File

@@ -131,7 +131,9 @@ class AccountStatementProfil(Model):
Hook to build the values of the statement from the parser and Hook to build the values of the statement from the parser and
the profile. the profile.
""" """
return {'profile_id': profile_id} vals = {'profile_id': profile_id}
vals.update(parser.get_st_vals())
return vals
def statement_import(self, cr, uid, ids, profile_id, file_stream, ftype="csv", context=None): def statement_import(self, cr, uid, ids, profile_id, file_stream, ftype="csv", context=None):
""" """