mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
protect import
This commit is contained in:
@@ -24,10 +24,6 @@ import datetime
|
|||||||
from openerp.tools.translate import _
|
from openerp.tools.translate import _
|
||||||
from openerp.addons.account_statement_base_import.parser import \
|
from openerp.addons.account_statement_base_import.parser import \
|
||||||
BankStatementImportParser
|
BankStatementImportParser
|
||||||
try:
|
|
||||||
import ofxparse
|
|
||||||
except:
|
|
||||||
raise Exception(_('Please install python lib ofxparse'))
|
|
||||||
|
|
||||||
|
|
||||||
class OfxParser(BankStatementImportParser):
|
class OfxParser(BankStatementImportParser):
|
||||||
@@ -50,6 +46,10 @@ class OfxParser(BankStatementImportParser):
|
|||||||
|
|
||||||
def _parse(self, *args, **kwargs):
|
def _parse(self, *args, **kwargs):
|
||||||
"""Launch the parsing itself."""
|
"""Launch the parsing itself."""
|
||||||
|
try:
|
||||||
|
import ofxparse
|
||||||
|
except:
|
||||||
|
raise Exception(_('Please install python lib ofxparse'))
|
||||||
ofx_file = tempfile.NamedTemporaryFile()
|
ofx_file = tempfile.NamedTemporaryFile()
|
||||||
ofx_file.seek(0)
|
ofx_file.seek(0)
|
||||||
ofx_file.write(self.filebuffer)
|
ofx_file.write(self.filebuffer)
|
||||||
|
|||||||
Reference in New Issue
Block a user