-
  In order to check account voucher module in OpenERP I create a customer voucher
-
  !record {model: account.voucher, id: account_voucher_voucherforaxelor0, view: view_sale_receipt_form}:
    type: sale
    account_id: account.cash
    amount: 1000.0
    company_id: base.main_company
    journal_id: account.sales_journal
    name: Voucher for Axelor
    narration: Basic Pc
    line_cr_ids:
      - account_id: account.a_recv
        amount: 1000.0
        name: Voucher for Axelor
    partner_id: base.res_partner_12
    period_id: account.period_6
    reference: none

-
  I check that Initially customer voucher is in the "Draft" state
-
  !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
    - state == 'draft'
-
  I compute the voucher to calculate the taxes by clicking Compute button
-
  !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucherforaxelor0}

-
  I create voucher by clicking on Create button
-
  !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucherforaxelor0}
-
  I clicked on Validate Button
-
  !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
    - state == 'posted'

-
  I check that Moves get created for this voucher
-
  !python {model: account.voucher}: |
    acc_id=self.browse(cr, uid, ref("account_voucher_voucherforaxelor0"))
    assert(acc_id.move_id)


-
  Now I create a Vendor Voucher
-
  !record {model: account.voucher, id: account_voucher_voucheraxelor0, view: view_voucher_filter_vendor}:
    type: purchase
    account_id: account.cash
    amount: 1000.0
    company_id: base.main_company
    journal_id: account.bank_journal
    name: Voucher Axelor
    narration: PC Assemble SC234
    line_dr_ids:
      - account_id: account.cash
        amount: 1000.0
        name: Voucher Axelor
    partner_id: base.res_partner_12
    period_id: account.period_6
    reference: none

-
  I check that Initially vendor voucher is in the "Draft" state
-
  !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
    - state == 'draft'
-
  I create voucher by clicking on Create button
-
  !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucheraxelor0}
-
  I check that the voucher state is "posted"
-
  !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
    - state == 'posted'
-
  I check that moves get created for this voucher
-
  !python {model: account.voucher}: |
    acc_id=self.browse(cr, uid, ref("account_voucher_voucheraxelor0"))
    assert(acc_id.move_id)
