Skip to content

Commit

Permalink
Merge pull request OCA#103 from gurneyalex/7.0-protect-import
Browse files Browse the repository at this point in the history
protect import
  • Loading branch information
pedrobaeza committed Oct 26, 2016
2 parents ae6ba58 + 752898e commit a9fcdcd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions account_statement_ofx_import/parser/ofx_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
from openerp.tools.translate import _
from openerp.addons.account_statement_base_import.parser import \
BankStatementImportParser
try:
import ofxparse
except:
raise Exception(_('Please install python lib ofxparse'))


class OfxParser(BankStatementImportParser):
Expand All @@ -50,6 +46,10 @@ def _pre(self, *args, **kwargs):

def _parse(self, *args, **kwargs):
"""Launch the parsing itself."""
try:
import ofxparse
except:
raise Exception(_('Please install python lib ofxparse'))
ofx_file = tempfile.NamedTemporaryFile()
ofx_file.seek(0)
ofx_file.write(self.filebuffer)
Expand Down

0 comments on commit a9fcdcd

Please sign in to comment.