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