[IMP] hr: onboarding
[odoo/odoo.git] / addons / account_voucher / test / account_voucher.yml
1 -
2   I check the voucher module with user who is accountant.
3 -
4   !context
5     uid: 'res_users_account_voucher_user'
6
7 -
8   In order to check account voucher module in OpenERP I create a customer voucher
9 -
10   !record {model: account.voucher, id: account_voucher_voucherforaxelor0, view: view_sale_receipt_form}:
11     type: sale
12     account_id: account.cash
13     amount: 1000.0
14     company_id: base.main_company
15     journal_id: account.sales_journal
16     name: Voucher for Axelor
17     narration: Basic Pc
18     line_cr_ids:
19       - account_id: account.a_recv
20         amount: 1000.0
21         name: Voucher for Axelor
22     partner_id: base.res_partner_12
23     period_id: account.period_6
24     reference: none
25
26 -
27   I check that Initially customer voucher is in the "Draft" state
28 -
29   !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
30     - state == 'draft'
31 -
32   I compute the voucher to calculate the taxes by clicking Compute button
33 -
34   !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucherforaxelor0}
35
36 -
37   I create voucher by clicking on Create button
38 -
39   !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucherforaxelor0}
40 -
41   I clicked on Validate Button
42 -
43   !assert {model: account.voucher, id: account_voucher_voucherforaxelor0}:
44     - state == 'posted'
45
46 -
47   I check that Moves get created for this voucher
48 -
49   !python {model: account.voucher}: |
50     acc_id=self.browse(cr, uid, ref("account_voucher_voucherforaxelor0"))
51     assert(acc_id.move_id)
52
53
54 -
55   Now I create a Vendor Voucher
56 -
57   !record {model: account.voucher, id: account_voucher_voucheraxelor0, view: view_voucher_filter_vendor}:
58     type: purchase
59     account_id: account.cash
60     amount: 1000.0
61     company_id: base.main_company
62     journal_id: account.bank_journal
63     name: Voucher Axelor
64     narration: PC Assemble SC234
65     line_dr_ids:
66       - account_id: account.cash
67         amount: 1000.0
68         name: Voucher Axelor
69     partner_id: base.res_partner_12
70     period_id: account.period_6
71     reference: none
72
73 -
74   I check that Initially vendor voucher is in the "Draft" state
75 -
76   !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
77     - state == 'draft'
78 -
79   I create voucher by clicking on Create button
80 -
81   !workflow {model: account.voucher, action: proforma_voucher, ref: account_voucher_voucheraxelor0}
82 -
83   I check that the voucher state is "posted"
84 -
85   !assert {model: account.voucher, id: account_voucher_voucheraxelor0}:
86     - state == 'posted'
87 -
88   I check that moves get created for this voucher
89 -
90   !python {model: account.voucher}: |
91     acc_id=self.browse(cr, uid, ref("account_voucher_voucheraxelor0"))
92     assert(acc_id.move_id)