-
  In order to test account_payment in OpenERP I created a new Bank Record
-
  Creating a res.partner.bank record
-
  !record {model: res.partner.bank, id: res_partner_bank_0}:
    acc_number: '126-2013269-08'
    partner_id: base.res_partner_9
    sequence: 0.0
    state: bank
    bank: base.res_bank_1
-
  I created a new Payment Mode
-
  Creating a payment.mode record
-
  !record {model: payment.mode, id: payment_mode_m0}:
    bank_id: res_partner_bank_0
    journal: account.bank_journal
    name: TestMode

-
  I created a Supplier Invoice
-
  Creating a account.invoice record
-
  !record {model: account.invoice, id: account_invoice_payment}:
    account_id: account.a_pay
    address_contact_id: base.res_partner_address_tang
    address_invoice_id: base.res_partner_address_tang
    check_total: 300.0
    company_id: base.main_company
    currency_id: base.EUR
    invoice_line:
      - account_id: account.a_expense
        name: '[PC1] Basic PC'
        price_unit: 300.0
        product_id: product.product_product_pc1
        quantity: 1.0
        uos_id: product.product_uom_unit
    journal_id: account.expenses_journal
    partner_id: base.res_partner_asus
    reference_type: none
    type: in_invoice

-
  I make the supplier invoice in Open state
-
  Performing a workflow action invoice_open on module account.invoice
-
  !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_payment}

-
  I create a new payment order
-
  Creating a payment.order record
-
  !record {model: payment.order, id: payment_order_0}:
    date_prefered: due
    mode: payment_mode_m0
    reference: !eval "'%s/006' %(datetime.now().year)"
    user_id: base.user_root


-
  Creating a payment.order.create record
-
  !record {model: payment.order.create, id: payment_order_create_0}:
    duedate: !eval time.strftime('%Y-%m-%d')

-
  I searched the entries using "Payment Create Order" wizard
-
  Performing an osv_memory action search_entries on module payment.order.create
-
  !python {model: payment.order.create}: |
    self.search_entries(cr, uid, [ref("payment_order_create_0")], {"lang": "en_US",
      "active_model": "payment.order", "active_ids": [ref("payment_order_0")],
      "tz": False, "active_id": ref("payment_order_0"), })
-
  I check that Initially Payment order is in "draft" state
-
  !assert {model: payment.order, id: payment_order_0}:
    - state == 'draft'
-
  I pressed the confirm payment button to confirm the payment
-
  Performing a workflow action open on module payment.order
-
  !workflow {model: payment.order, action: open, ref: payment_order_0}
-
  I check that Payment order is in "Confirmed" state
-
  !assert {model: payment.order, id: payment_order_0}:
    - state == 'open'
-
  I paid the payment using "Make Payments" Button
-
  Creating a account.payment.make.payment record
-
  !record {model: account.payment.make.payment, id: account_payment_make_payment_0}:
    {}

-
  Performing an osv_memory action launch_wizard on module account.payment.make.payment
-
  !python {model: account.payment.make.payment}: |
    self.launch_wizard(cr, uid, [ref("account_payment_make_payment_0")], {"lang":
      "en_US", "active_model": "payment.order", "active_ids": [ref("payment_order_0")], "tz":
      False, "active_id": ref("payment_order_0"), })

-
  I check that Payment order is in "Done" state
-
  !assert {model: payment.order, id: payment_order_0}:
    - state == 'done'


