odoo/addons/account_voucher/test/account_voucher.yml

86 lines
2.5 KiB
YAML

-
In order to check account voucher module in OpenERP I create a customer voucher
-
!record {model: account.voucher, id: account_voucher_voucherforaxelor0}:
account_id: account.cash
amount: 1000.0
company_id: base.main_company
journal_id: account.bank_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: False}:
account_id: account.cash
amount: 1000.0
company_id: base.main_company
currency_id: base.EUR
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)