[merge]
[odoo/odoo.git] / addons / account_payment / test / account_payment.yml
1 -
2   In order to test account_payment in OpenERP I create a new record Type.
3 -
4   !record {model: payment.type, id: payment_type_t0}:
5     code: T0
6     name: TestType
7
8 -
9   I created a new Bank Record
10 -
11   Creating a res.partner.bank record
12 -
13   !record {model: res.partner.bank, id: res_partner_bank_0}:
14     acc_number: '0001'
15     partner_id: base.res_partner_9
16     sequence: 0.0
17     state: bank
18
19 -
20   I created a new Payment Mode
21 -
22   Creating a payment.mode record
23 -
24   !record {model: payment.mode, id: payment_mode_m0}:
25     bank_id: res_partner_bank_0
26     journal: account.bank_journal
27     name: TestMode
28     type: payment_type_t0
29
30 -
31   I created a Supplier Invoice
32 -
33   Creating a account.invoice record
34 -
35   !record {model: account.invoice, id: account_invoice_payment}:
36     account_id: account.a_pay
37     address_contact_id: base.res_partner_address_tang
38     address_invoice_id: base.res_partner_address_tang
39     check_total: 300.0
40     company_id: base.main_company
41     currency_id: base.EUR
42     invoice_line:
43       - account_id: account.a_expense
44         name: '[PC1] Basic PC'
45         price_unit: 300.0
46         product_id: product.product_product_pc1
47         quantity: 1.0
48         uos_id: product.product_uom_unit
49     journal_id: account.expenses_journal
50     partner_id: base.res_partner_asus
51     reference_type: none
52     type: in_invoice
53
54 -
55   I make the supplier invoice in Open state
56 -
57   Performing a workflow action invoice_open on module account.invoice
58 -
59   !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_payment}
60
61 -
62   I create a new payment order
63 -
64   Creating a payment.order record
65 -
66   !record {model: payment.order, id: payment_order_0}:
67     date_prefered: due
68     mode: payment_mode_m0
69     reference: 2010/006
70     user_id: base.user_root
71
72
73 -
74   Creating a payment.order.create record
75 -
76   !record {model: payment.order.create, id: payment_order_create_0}:
77     duedate: '2010-06-04'
78
79 -
80   I searched the entries using "Payment Create Order" wizard
81 -
82   Performing an osv_memory action search_entries on module payment.order.create
83 -
84   !python {model: payment.order.create}: |
85     self.search_entries(cr, uid, [ref("payment_order_create_0")], {"lang": "en_US",
86       "active_model": "payment.order", "active_ids": [ref("payment_order_0")],
87       "tz": False, "active_id": ref("payment_order_0"), })
88 -
89   I check that Initially Payment order is in "draft" state
90 -
91   !assert {model: payment.order, id: payment_order_0}:
92     - state == 'draft'
93 -
94   I pressed the confirm payment button to confirm the payment
95 -
96   Performing a workflow action open on module payment.order
97 -
98   !workflow {model: payment.order, action: open, ref: payment_order_0}
99 -
100   I check that Payment order is in "Confirmed" state
101 -
102   !assert {model: payment.order, id: payment_order_0}:
103     - state == 'open'
104 -
105   I paid the payment using "Make Payments" Button
106 -
107   Creating a account.payment.make.payment record
108 -
109   !record {model: account.payment.make.payment, id: account_payment_make_payment_0}:
110     {}
111
112 -
113   Performing an osv_memory action launch_wizard on module account.payment.make.payment
114 -
115   !python {model: account.payment.make.payment}: |
116     self.launch_wizard(cr, uid, [ref("account_payment_make_payment_0")], {"lang":
117       "en_US", "active_model": "payment.order", "active_ids": [ref("payment_order_0")], "tz":
118       False, "active_id": ref("payment_order_0"), })
119
120 -
121   I check that Payment order is in "Done" state
122 -
123   !assert {model: payment.order, id: payment_order_0}:
124     - state == 'done'
125
126