2 Test with that user which have rights to make Invoicing.
5 uid: 'res_users_account_user'
7 In order to test Confirm Draft Invoice wizard I create an invoice and confirm it with this wizard
9 !record {model: account.invoice, id: account_invoice_state}:
10 account_id: account.a_recv
11 company_id: base.main_company
14 - account_id: account.a_sale
15 name: '[PCSC234] PC Assemble SC234'
18 product_id: product.product_product_3
19 uos_id: product.product_uom_unit
20 journal_id: account.bank_journal
21 partner_id: base.res_partner_12
24 I check that Initially customer invoice state is "Draft"
26 !assert {model: account.invoice, id: account_invoice_state}:
29 I called the "Confirm Draft Invoices" wizard
31 !record {model: account.invoice.confirm, id: account_invoice_confirm_0}:
34 I clicked on Confirm Invoices Button
36 !python {model: account.invoice.confirm}: |
37 self.invoice_confirm(cr, uid, [ref("account_invoice_confirm_0")], {"lang": 'en_US',
38 "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_state")],
39 "type": "out_invoice", "active_id": ref("account_invoice_state"), })
41 I check that customer invoice state is "Open"
43 !assert {model: account.invoice, id: account_invoice_state}:
46 I Modified the journal record so it can cancel invoice
48 !record {model: account.journal, id: account.bank_journal}:
53 In order to check the "Cancel Selected Invoices" wizard in openerp I cancelled this open invoice using this wizard
55 !record {model: account.invoice.cancel, id: account_invoice_cancel_0}:
59 I clicked on Cancel Invoices Button
61 !python {model: account.invoice.cancel}: |
62 self.invoice_cancel(cr, uid, [ref("account_invoice_cancel_0")], {"lang": 'en_US',
63 "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_state")],
64 "type": "out_invoice", "active_id": ref("account_invoice_state"), })
67 I check that customer invoice is in the cancel state
69 !assert {model: account.invoice, id: account_invoice_state}: