[ADD] account_voucher:YML test file, account_voucher_payment:YML test file
[odoo/odoo.git] / addons / account_voucher / test / account_voucher.yml
1
2 -
3   In order to check account voucher module in OpenERP I create a customer voucher
4 -
5   !record {model: account.voucher, id: account_voucher_voucherforaxelor0}:
6     account_id: account.cash
7     company_id: base.main_company
8     currency_id: base.EUR
9     journal_id: account.bank_journal
10     name: Voucher for Axelor
11     narration: Basic Pc
12     payment_ids:
13       - account_id: account.a_recv
14         amount: 1000.0
15         name: Voucher for Axelor
16         partner_id: base.res_partner_desertic_hispafuentes
17     period_id: account.period_6
18     reference_type: none
19
20 -
21   I check that Initially customer voucher is in the "Draft" state
22 -
23   !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
24     - state == 'draft'
25 -
26   I change the state of voucher to "proforma" by clicking PRO-FORMA button
27 -
28   !workflow {model: account.voucher, action: open_voucher, ref: account_voucher_voucherforaxelor0}
29 -
30   I check that the voucher state is now "proforma"
31 -
32   !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
33     - state == 'proforma'
34 -
35   I create voucher by clicking on Create button
36 -
37   !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucherforaxelor0}
38 -
39   I check that the voucher state is "Waiting for re-checking"
40 -
41   !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
42     - state == 'recheck'
43 -
44   I clicked on Validate Button
45 -
46   !workflow {model: account.voucher, action: recheck_voucher, ref: account_voucher_voucherforaxelor0}
47 -
48   I check that the voucher state is "posted"
49 -
50   !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
51     - state == 'posted'
52
53 -
54   I check that Moves get created for this voucher
55 -
56   !python {model: account.voucher}: |
57     acc_id=self.browse(cr, uid, ref("account_voucher_voucherforaxelor0"))
58     assert(acc_id.move_id)
59
60
61 -
62   Now I create a Vendor Voucher
63 -
64   !record {model: account.voucher, id: account_voucher_voucheraxelor0}:
65     account_id: account.cash
66     company_id: base.main_company
67     currency_id: base.EUR
68     journal_id: account.bank_journal
69     name: Voucher Axelor
70     narration: Basic PC
71     payment_ids:
72       - account_id: account.cash
73         amount: 1000.0
74         name: Voucher Axelor
75     period_id: account.period_6
76     reference_type: none
77
78 -
79   I check that Initially vendor voucher is in the "Draft" state
80 -
81   !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
82     - state == 'draft'
83 -
84   I change the state of voucher to "proforma" by clicking PRO-FORMA button
85 -
86   !workflow {model: account.voucher, action: open_voucher, ref: account_voucher_voucheraxelor0}
87 -
88   I check that the voucher state is now "proforma"
89 -
90   !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
91     - state == 'proforma'
92 -
93   I create voucher by clicking on Create button
94 -
95   !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucheraxelor0}
96 -
97   I check that the voucher state is "Waiting for re-checking"
98 -
99   !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
100     - state == 'recheck'
101 -
102   I clicked on Validate Button
103 -
104   !workflow {model: account.voucher, action: recheck_voucher, ref: account_voucher_voucheraxelor0}
105 -
106   I check that the voucher state is "posted"
107 -
108   !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
109     - state == 'posted'
110
111 -
112   I check that moves get created for this voucher
113 -
114   !python {model: account.voucher}: |
115     acc_id=self.browse(cr, uid, ref("account_voucher_voucheraxelor0"))
116     assert(acc_id.move_id)