-
  In order to test the banking framework, I first need to create a journal
-
  !record {model: account.journal, id: account.bank_journal}:
    used_for_completion: True
    rule_ids:
      - bank_statement_completion_rule_trans_id_invoice
-
  Now I create a move. I create statment lines separately because I need
  to find each one by XML id
-
 !record {model: account.move, id: move_invoice_transactionid_test1}:
    name: Move with transaction ID
    journal_id: account.bank_journal
    company_id: base.main_company
-
  I create a move line for a SO with transaction ID
-
  !record {model: account.move.line, id: move_line_invoice_transactionid}:
    name: Test autocompletion based on invoice with transaction ID
    account_id: account.a_sale
    move_id: move_invoice_transactionid_test1
    transaction_ref: XXX77Z
    date_maturity: !eval time.strftime('%Y-%m-%d')
    credit: 0.0
-
  and add the correct amount
-
  !python {model: account.move.line}: |
    context['check_move_validity'] = False
    model.write(cr, uid, [ref('move_line_invoice_transactionid')],
                {'credit': 450.0},
                context)
-
  I run the auto complete
-
  !python {model: account.move}: |
    result = self.button_auto_completion(cr, uid, [ref("move_invoice_transactionid_test1")])
-
  Now I can check that all is nice and shiny, line 1. I expect the invoice has been
  recognised from the transaction ID.
-
  !assert {model: account.move.line, id: move_line_invoice_transactionid, string: Check completion by Invoice transaction ID}:
    - partner_id.name == u'Agrolait'
