-
  I check the voucher module with user who is accountant.
-
  !context
    uid: 'res_users_account_voucher_user'

-
  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}:
    voucher_type: sale
    account_id: a_cash
    amount: 1000.0
    company_id: base.main_company
    journal_id: sales_journal
    name: Voucher for Axelor
    narration: Basic Pc
    line_ids:
      - account_id: a_recv
        price_unit: 1000.0
        name: Voucher for Axelor
    partner_id: base.res_partner_12
    date: !eval time.strftime('%Y-%m-%d')
    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}:
    voucher_type: purchase
    account_id: a_cash
    amount: 1000.0
    company_id: base.main_company
    journal_id: j_cash
    name: Voucher Axelor
    narration: PC Assemble SC234
    line_ids:
      - account_id: a_cash
        price_unit: 1000.0
        name: Voucher Axelor
    partner_id: base.res_partner_12
    date: !eval time.strftime('%Y-%m-%d')
    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)
