-
  Create demo bank statement
-
  !python {model: ir.model.data} : |
      journal_id = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'bank')])
      import time
      if journal_id:
          journal_id = journal_id[0]
          vals = {
              'journal_id': journal_id,
              'date': time.strftime('%Y')+'-01-01',
              'name': "BNK/2014/001",
              'balance_end_real': '8998.2',
              'company_id': ref('base.main_company'),
              'balance_start': 5103.0
          }
          self._update(cr, uid, 'account.bank.statement', 'account', vals, 'demo_bank_statement_1')
          vals = {
              'ref': '',
              'statement_id': ref('account.demo_bank_statement_1'),
              'sequence': 1,
              'company_id': ref('base.main_company'),
              'name': "SAJ/2014/002 and SAJ/2014/003",
              'journal_id': journal_id,
              'amount': 1175.0,
              'date': time.strftime('%Y')+'-01-01',
              'partner_id': ref('base.res_partner_2'),
          }
          self._update(cr, uid, 'account.bank.statement.line', 'account', vals, 'demo_bank_statement_line_1')
          vals = {
              'ref': '',
              'statement_id': ref('account.demo_bank_statement_1'),
              'sequence': 2,
              'company_id': ref('base.main_company'),
              'name': "Bank fees",
              'journal_id': journal_id,
              'amount': -32.58,
              'date': time.strftime('%Y')+'-01-01',
          }
          self._update(cr, uid, 'account.bank.statement.line', 'account', vals, 'demo_bank_statement_line_2')
          vals = {
              'ref': '',
              'statement_id': ref('account.demo_bank_statement_1'),
              'sequence': 3,
              'company_id': ref('base.main_company'),
              'name': "Prepayment",
              'journal_id': journal_id,
              'amount': 650.0,
              'date': time.strftime('%Y')+'-01-01',
              'partner_id': ref('base.res_partner_12'),
          }
          self._update(cr, uid, 'account.bank.statement.line', 'account', vals, 'demo_bank_statement_line_3')
          vals = {
              'ref': '',
              'statement_id': ref('account.demo_bank_statement_1'),
              'sequence': 4,
              'company_id': ref('base.main_company'),
              'name': "First 2000 € of SAJ/2014/001",
              'journal_id': journal_id,
              'amount': 2000.0,
              'date': time.strftime('%Y')+'-01-01',
              'partner_id': ref('base.res_partner_12'),
          }
          self._update(cr, uid, 'account.bank.statement.line', 'account', vals, 'demo_bank_statement_line_4')
          vals = {
              'ref': '',
              'statement_id': ref('account.demo_bank_statement_1'),
              'sequence': 5,
              'company_id': ref('base.main_company'),
              'name': "Last Year Interests",
              'journal_id': journal_id,
              'amount': 102.78,
              'date': time.strftime('%Y')+'-01-01',
          }
          self._update(cr, uid, 'account.bank.statement.line', 'account', vals, 'demo_bank_statement_line_5')
