2 In order to test account_payment in OpenERP I created a new Bank Record
4 Creating a res.partner.bank record
6 !record {model: res.partner.bank, id: res_partner_bank_0}:
7 name: 'Test Bank Account'
9 partner_id: base.res_partner_9
15 I created a new Payment Mode
17 Creating a payment.mode record
19 !record {model: payment.mode, id: payment_mode_m0}:
20 bank_id: res_partner_bank_0
21 journal: account.bank_journal
25 I created a Supplier Invoice
27 Creating a account.invoice record
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
34 company_id: base.main_company
37 - account_id: account.a_expense
38 name: '[PC1] Basic PC'
40 product_id: product.product_product_pc1
42 uos_id: product.product_uom_unit
43 journal_id: account.expenses_journal
44 partner_id: base.res_partner_asus
49 I make the supplier invoice in Open state
51 Performing a workflow action invoice_open on module account.invoice
53 !workflow {model: account.invoice, action: invoice_open, ref: account_invoice_payment}
56 I create a new payment order
58 Creating a payment.order record
60 !record {model: payment.order, id: payment_order_0}:
63 reference: !eval "'%s/006' %(datetime.now().year)"
64 user_id: base.user_root
68 Creating a payment.order.create record
70 !record {model: payment.order.create, id: payment_order_create_0}:
71 duedate: !eval time.strftime('%Y-%m-%d')
74 I searched the entries using "Payment Create Order" wizard
76 Performing an osv_memory action search_entries on module payment.order.create
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"), })
83 I check that Initially Payment order is in "draft" state
85 !assert {model: payment.order, id: payment_order_0}:
88 I pressed the confirm payment button to confirm the payment
90 Performing a workflow action open on module payment.order
92 !workflow {model: payment.order, action: open, ref: payment_order_0}
94 I check that Payment order is in "Confirmed" state
96 !assert {model: payment.order, id: payment_order_0}:
99 I paid the payment using "Make Payments" Button
101 Creating a account.payment.make.payment record
103 !record {model: account.payment.make.payment, id: account_payment_make_payment_0}:
107 Performing an osv_memory action launch_wizard on module account.payment.make.payment
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"), })
115 I check that Payment order is in "Done" state
117 !assert {model: payment.order, id: payment_order_0}: