mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
Little trick to avoid headhack
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
##############################################################################
|
||||
|
||||
{'name': "Bank statement base import",
|
||||
'version': '1.0.3',
|
||||
'version': '1.0.4',
|
||||
'author': 'Camptocamp',
|
||||
'maintainer': 'Camptocamp',
|
||||
'category': 'Finance',
|
||||
|
||||
@@ -26,6 +26,7 @@ import datetime
|
||||
from openerp.osv.orm import Model
|
||||
from openerp.osv import fields, osv
|
||||
from parser import new_bank_statement_parser
|
||||
from openerp.tools.config import config
|
||||
|
||||
|
||||
class AccountStatementProfil(Model):
|
||||
@@ -229,6 +230,11 @@ class AccountStatementProfil(Model):
|
||||
error_type, error_value, trbk = sys.exc_info()
|
||||
st = "Error: %s\nDescription: %s\nTraceback:" % (error_type.__name__, error_value)
|
||||
st += ''.join(traceback.format_tb(trbk, 30))
|
||||
#TODO we should catch correctly the exception with a python
|
||||
#Exception and only re-catch some special exception.
|
||||
#For now we avoid re-catching error in debug mode
|
||||
if config['debug_mode']:
|
||||
raise
|
||||
raise osv.except_osv(_("Statement import error"),
|
||||
_("The statement cannot be created: %s") % st)
|
||||
return statement_id
|
||||
|
||||
Reference in New Issue
Block a user