Browse Source

[FIX] Make flake and pylint happy.

No automatic creation of journals. Provide demo data to succesfully
run tests.
pull/6/head^2
Ronald Portier (Therp BV) 10 years ago
parent
commit
4d3e5c6636
  1. 3
      account_bank_statement_import/account_bank_statement_import.py
  2. 4
      account_bank_statement_import_ofx/__openerp__.py
  3. 27
      account_bank_statement_import_ofx/demo/demo_data.xml

3
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) # 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 # 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: 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) journal_id = self._create_journal(cr, uid, currency_id, account_number, context=context)
if bank_account_id: if bank_account_id:
bank_pool.write(cr, uid, [bank_account_id], {'journal_id': journal_id}, context=context) 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 we couldn't find/create a journal, everything is lost
if not journal_id: if not journal_id:

4
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. create periods for the year 2013.
""", """,
'data' : [], 'data' : [],
'demo': [],
'demo': [
'demo/demo_data.xml',
],
'auto_install': False, 'auto_install': False,
'installable': True, 'installable': True,
} }

27
account_bank_statement_import_ofx/demo/demo_data.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="ofx_bank_journal" model="account.journal">
<field name="name">Bank Journal - (test ofx)</field>
<field name="code">TBNKOFX</field>
<field name="type">bank</field>
<field name="sequence_id" ref="account.sequence_bank_journal"/>
<field name="default_debit_account_id" ref="account.usd_bnk"/>
<field name="default_credit_account_id" ref="account.usd_bnk"/>
<field name="user_id" ref="base.user_root"/>
<field name="currency" ref="base.USD"/>
</record>
<record id="ofx_company_bank" model="res.partner.bank">
<field name="owner_name">Your Company</field>
<field name="acc_number">123456</field>
<field name="partner_id" ref="base.partner_root"></field>
<field name="company_id" ref="base.main_company"></field>
<field name="journal_id" ref="ofx_bank_journal"></field>
<field name="state">bank</field>
<field name="bank" ref="base.res_bank_1"/>
</record>
</data>
</openerp>
Loading…
Cancel
Save