From 5f3e8cf3d9a693fe331ddd7441a9ffc73f9180d2 Mon Sep 17 00:00:00 2001 From: "Ronald Portier (Therp BV)" Date: Fri, 6 Feb 2015 00:35:03 +0100 Subject: [PATCH 1/3] [FIX] Error with duplicate key currency_id in dict. --- account_bank_statement_import/account_bank_statement_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_bank_statement_import/account_bank_statement_import.py b/account_bank_statement_import/account_bank_statement_import.py index 358901e1..7b7b6a24 100644 --- a/account_bank_statement_import/account_bank_statement_import.py +++ b/account_bank_statement_import/account_bank_statement_import.py @@ -174,7 +174,7 @@ class account_bank_statement_import(osv.TransientModel): wmca_pool = self.pool.get('wizard.multi.charts.accounts') company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id - vals_account = {'currency_id': currency_id, 'acc_name': account_number, 'account_type': 'bank', 'currency_id': currency_id} + vals_account = {'currency_id': currency_id, 'acc_name': account_number, 'account_type': 'bank'} vals_account = wmca_pool._prepare_bank_account(cr, uid, company, vals_account, context=context) account_id = self.pool.get('account.account').create(cr, uid, vals_account, context=context) From 4d3e5c6636f01a82e750387ad268b128725c1eba Mon Sep 17 00:00:00 2001 From: "Ronald Portier (Therp BV)" Date: Sat, 7 Feb 2015 02:09:35 +0100 Subject: [PATCH 2/3] [FIX] Make flake and pylint happy. No automatic creation of journals. Provide demo data to succesfully run tests. --- .../account_bank_statement_import.py | 3 +++ .../__openerp__.py | 4 ++- .../demo/demo_data.xml | 27 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 account_bank_statement_import_ofx/demo/demo_data.xml diff --git a/account_bank_statement_import/account_bank_statement_import.py b/account_bank_statement_import/account_bank_statement_import.py index 7b7b6a24..d12e23cf 100644 --- a/account_bank_statement_import/account_bank_statement_import.py +++ b/account_bank_statement_import/account_bank_statement_import.py @@ -158,10 +158,13 @@ class account_bank_statement_import(osv.TransientModel): # If there is no journal, create one (and its account) # I think it's too dangerous, so I disable that code by default -- Alexis de Lattre + """ + # -- Totally disabled, Ronald Portier if context.get('allow_auto_create_journal') and not journal_id and account_number: journal_id = self._create_journal(cr, uid, currency_id, account_number, context=context) if bank_account_id: bank_pool.write(cr, uid, [bank_account_id], {'journal_id': journal_id}, context=context) + """ # If we couldn't find/create a journal, everything is lost if not journal_id: diff --git a/account_bank_statement_import_ofx/__openerp__.py b/account_bank_statement_import_ofx/__openerp__.py index 8d2d4ee8..8a10b59b 100644 --- a/account_bank_statement_import_ofx/__openerp__.py +++ b/account_bank_statement_import_ofx/__openerp__.py @@ -25,7 +25,9 @@ base account_bank_statement_import module has been imported, or manually create periods for the year 2013. """, 'data' : [], - 'demo': [], + 'demo': [ + 'demo/demo_data.xml', + ], 'auto_install': False, 'installable': True, } diff --git a/account_bank_statement_import_ofx/demo/demo_data.xml b/account_bank_statement_import_ofx/demo/demo_data.xml new file mode 100644 index 00000000..8387f272 --- /dev/null +++ b/account_bank_statement_import_ofx/demo/demo_data.xml @@ -0,0 +1,27 @@ + + + + + + Bank Journal - (test ofx) + TBNKOFX + bank + + + + + + + + + Your Company + 123456 + + + + bank + + + + + From d999af6fbbbf39212ebc03b8ad50c6f4496c8e33 Mon Sep 17 00:00:00 2001 From: "Ronald Portier (Therp BV)" Date: Sat, 7 Feb 2015 02:47:09 +0100 Subject: [PATCH 3/3] [FIX] Use hashes to comment out code. When using string delimiters to comment out code (""" before and after), pylint will complain about useless strings. --- .../account_bank_statement_import.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/account_bank_statement_import/account_bank_statement_import.py b/account_bank_statement_import/account_bank_statement_import.py index d12e23cf..ff1252d5 100644 --- a/account_bank_statement_import/account_bank_statement_import.py +++ b/account_bank_statement_import/account_bank_statement_import.py @@ -158,13 +158,11 @@ class account_bank_statement_import(osv.TransientModel): # If there is no journal, create one (and its account) # I think it's too dangerous, so I disable that code by default -- Alexis de Lattre - """ # -- Totally disabled, Ronald Portier - if context.get('allow_auto_create_journal') and not journal_id and account_number: - journal_id = self._create_journal(cr, uid, currency_id, account_number, context=context) - if bank_account_id: - bank_pool.write(cr, uid, [bank_account_id], {'journal_id': journal_id}, context=context) - """ + # if context.get('allow_auto_create_journal') and not journal_id and account_number: + # journal_id = self._create_journal(cr, uid, currency_id, account_number, context=context) + # if bank_account_id: + # bank_pool.write(cr, uid, [bank_account_id], {'journal_id': journal_id}, context=context) # If we couldn't find/create a journal, everything is lost if not journal_id: