[MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9529 rev-id: mat@openerp...
[odoo/odoo.git] / addons / account / test / account_invoice_state.yml
1 -
2   In order to test Confirm Draft Invoice wizard I create an invoice and confirm it with this wizard
3 -
4   !record {model: account.invoice, id: account_invoice_state}:
5     account_id: account.a_recv
6     company_id: base.main_company
7     currency_id: base.EUR
8     invoice_line:
9       - account_id: account.a_sale
10         name: '[PCSC234] PC Assemble SC234'
11         price_unit: 450.0
12         quantity: 1.0
13         product_id: product.product_product_3
14         uos_id: product.product_uom_unit
15     journal_id: account.bank_journal
16     partner_id: base.res_partner_12
17     reference_type: none
18 -
19   I check that Initially customer invoice state is "Draft"
20 -
21   !assert {model: account.invoice, id: account_invoice_state}:
22     - state == 'draft'
23 -
24   I called the "Confirm Draft Invoices" wizard
25 -
26   !record {model: account.invoice.confirm, id: account_invoice_confirm_0}:
27     {}
28 -
29   I clicked on Confirm Invoices Button
30 -
31   !python {model: account.invoice.confirm}: |
32     self.invoice_confirm(cr, uid, [ref("account_invoice_confirm_0")], {"lang": 'en_US',
33       "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_state")],
34       "type": "out_invoice", "active_id": ref("account_invoice_state"), })
35 -
36   I check that customer invoice state is "Open"
37 -
38   !assert {model: account.invoice, id: account_invoice_state}:
39     - state == 'open'
40 -
41   I Modified the journal record so it can cancel invoice
42 -
43   !record {model: account.journal, id: account.bank_journal}:
44     update_posted: 1
45
46
47 -
48   In order to check the "Cancel Selected Invoices" wizard in openerp I cancelled this open invoice using this wizard
49 -
50   !record {model: account.invoice.cancel, id: account_invoice_cancel_0}:
51     {}
52
53 -
54   I clicked on Cancel Invoices Button
55 -
56   !python {model: account.invoice.cancel}: |
57     self.invoice_cancel(cr, uid, [ref("account_invoice_cancel_0")], {"lang": 'en_US',
58       "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_state")],
59       "type": "out_invoice", "active_id": ref("account_invoice_state"), })
60
61 -
62   I check that customer invoice is in the cancel state
63 -
64   !assert {model: account.invoice, id: account_invoice_state}:
65     - state == 'cancel'
66