-
  In order to test Confirm Draft Invoice wizard I create an invoice and confirm it with this wizard
-
  !record {model: account.invoice, id: account_invoice_state}:
    account_id: account.a_recv
    company_id: base.main_company
    currency_id: base.EUR
    invoice_line:
      - account_id: account.a_sale
        name: '[PCSC234] PC Assemble SC234'
        price_unit: 450.0
        quantity: 1.0
        product_id: product.product_product_3
        uos_id: product.product_uom_unit
    journal_id: account.bank_journal
    partner_id: base.res_partner_12
    reference_type: none
-
  I check that Initially customer invoice state is "Draft"
-
  !assert {model: account.invoice, id: account_invoice_state}:
    - state == 'draft'
-
  I called the "Confirm Draft Invoices" wizard
-
  !record {model: account.invoice.confirm, id: account_invoice_confirm_0}:
    {}
-
  I clicked on Confirm Invoices Button
-
  !python {model: account.invoice.confirm}: |
    self.invoice_confirm(cr, uid, [ref("account_invoice_confirm_0")], {"lang": 'en_US',
      "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_state")],
      "type": "out_invoice", "active_id": ref("account_invoice_state"), })
-
  I check that customer invoice state is "Open"
-
  !assert {model: account.invoice, id: account_invoice_state}:
    - state == 'open'
-
  I Modified the journal record so it can cancel invoice
-
  !record {model: account.journal, id: account.bank_journal}:
    update_posted: 1


-
  In order to check the "Cancel Selected Invoices" wizard in openerp I cancelled this open invoice using this wizard
-
  !record {model: account.invoice.cancel, id: account_invoice_cancel_0}:
    {}

-
  I clicked on Cancel Invoices Button
-
  !python {model: account.invoice.cancel}: |
    self.invoice_cancel(cr, uid, [ref("account_invoice_cancel_0")], {"lang": 'en_US',
      "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_state")],
      "type": "out_invoice", "active_id": ref("account_invoice_state"), })

-
  I check that customer invoice is in the cancel state
-
  !assert {model: account.invoice, id: account_invoice_state}:
    - state == 'cancel'

