diff --git a/addons/account_bank_statement_import_ofx/__openerp__.py b/addons/account_bank_statement_import_ofx/__openerp__.py index fd800511594..57fff5258a0 100644 --- a/addons/account_bank_statement_import_ofx/__openerp__.py +++ b/addons/account_bank_statement_import_ofx/__openerp__.py @@ -17,7 +17,4 @@ creation of the Financial Accounting records). """, 'installable': True, 'auto_install': True, - 'external_dependencies' : { - 'python' : ['ofxparse'], - } } diff --git a/addons/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py b/addons/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py index 0a6855089ea..f332cc18497 100644 --- a/addons/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py +++ b/addons/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py @@ -5,24 +5,17 @@ import StringIO from openerp import api, models, _ from openerp.exceptions import UserError +from ofxparse import OfxParser _logger = logging.getLogger(__name__) -try: - from ofxparse import OfxParser as ofxparser -except ImportError: - _logger.warn("ofxparse not found, OFX parsing disabled.") - ofxparser = None - class AccountBankStatementImport(models.TransientModel): _inherit = 'account.bank.statement.import' def _check_ofx(self, file): - if ofxparser is None: - return False try: - ofx = ofxparser.parse(file) + ofx = OfxParser.parse(file) except: return False return ofx diff --git a/debian/control b/debian/control index 45c9f530631..e1e549b29f1 100644 --- a/debian/control +++ b/debian/control @@ -27,6 +27,7 @@ Depends: python-lxml, python-mako, python-mock, + python-ofxparse, python-openid, python-passlib, python-psutil, diff --git a/requirements.txt b/requirements.txt index ab1c1f3a185..59e6663e68d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,6 +16,7 @@ greenlet==0.4.5 jcconv==0.2.3 lxml==3.4.1 mock==1.0.1 +ofxparse==0.14 passlib==1.6.2 psutil==2.2.0 psycogreen==1.0 diff --git a/setup.py b/setup.py index 27f170961d5..d361fc61b70 100644 --- a/setup.py +++ b/setup.py @@ -81,6 +81,7 @@ def py2exe_options(): 'mako', 'markupsafe', 'mock', + 'ofxparse', 'openerp', 'openid', 'passlib', @@ -139,6 +140,7 @@ setup( 'lxml', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/ 'mako', 'mock', + 'ofxparse', 'passlib', 'pillow', # windows binary http://www.lfd.uci.edu/~gohlke/pythonlibs/ 'psutil', # windows binary code.google.com/p/psutil/downloads/list diff --git a/setup/package.dfcentos b/setup/package.dfcentos index e524fcbd381..fd363f6210e 100644 --- a/setup/package.dfcentos +++ b/setup/package.dfcentos @@ -40,7 +40,7 @@ RUN yum install -d 0 -e 0 epel-release -y && \ postgresql-devel -y && \ yum clean all -RUN easy_install pyPdf vatnumber pydot psycogreen suds +RUN easy_install pyPdf vatnumber pydot psycogreen suds ofxparse # Postgres configuration RUN mkdir -p /var/lib/postgres/data diff --git a/setup/package.dfdebian b/setup/package.dfdebian index 4dfdc728e12..7636e86f0d9 100644 --- a/setup/package.dfdebian +++ b/setup/package.dfdebian @@ -31,6 +31,7 @@ RUN apt-get update -qq && \ python-lxml \ python-mako \ python-mock \ + python-ofxparse \ python-openid \ python-passlib \ python-psutil \ diff --git a/setup/redhat/postinstall.sh b/setup/redhat/postinstall.sh index 76a94359d3a..a0962cd62ff 100644 --- a/setup/redhat/postinstall.sh +++ b/setup/redhat/postinstall.sh @@ -54,4 +54,4 @@ ExecStart=/usr/bin/odoo.py --config=/etc/odoo/openerp-server.conf [Install] WantedBy=multi-user.target EOF -easy_install pyPdf vatnumber pydot psycogreen suds +easy_install pyPdf vatnumber pydot psycogreen suds ofxparse