diff --git a/account_statement_base_import/parser/parser.py b/account_statement_base_import/parser/parser.py index 377548b2..ad9f6c99 100644 --- a/account_statement_base_import/parser/parser.py +++ b/account_statement_base_import/parser/parser.py @@ -110,6 +110,14 @@ class BankStatementImportParser(object): """ 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): """ Implement a method in your parser that must return a dict of vals that can be diff --git a/account_statement_base_import/statement.py b/account_statement_base_import/statement.py index 51fbb08c..8da3c7b3 100644 --- a/account_statement_base_import/statement.py +++ b/account_statement_base_import/statement.py @@ -131,7 +131,9 @@ class AccountStatementProfil(Model): Hook to build the values of the statement from the parser and 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): """