[IMP] karma retag checks
[odoo/odoo.git] / addons / account / test / account_invoice_state.yml
1 -
2   Test with that user which have rights to make Invoicing. 
3 -
4   !context
5     uid: 'res_users_account_user'
6 -
7   In order to test Confirm Draft Invoice wizard I create an invoice and confirm it with this wizard
8 -
9   !record {model: account.invoice, id: account_invoice_state}:
10     account_id: account.a_recv
11     company_id: base.main_company
12     currency_id: base.EUR
13     invoice_line:
14       - account_id: account.a_sale
15         name: '[PCSC234] PC Assemble SC234'
16         price_unit: 450.0
17         quantity: 1.0
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
22     reference_type: none
23 -
24   I check that Initially customer invoice state is "Draft"
25 -
26   !assert {model: account.invoice, id: account_invoice_state}:
27     - state == 'draft'
28 -
29   I called the "Confirm Draft Invoices" wizard
30 -
31   !record {model: account.invoice.confirm, id: account_invoice_confirm_0}:
32     {}
33 -
34   I clicked on Confirm Invoices Button
35 -
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"), })
40 -
41   I check that customer invoice state is "Open"
42 -
43   !assert {model: account.invoice, id: account_invoice_state}:
44     - state == 'open'
45 -
46   I Modified the journal record so it can cancel invoice
47 -
48   !record {model: account.journal, id: account.bank_journal}:
49     update_posted: 1
50
51
52 -
53   In order to check the "Cancel Selected Invoices" wizard in openerp I cancelled this open invoice using this wizard
54 -
55   !record {model: account.invoice.cancel, id: account_invoice_cancel_0}:
56     {}
57
58 -
59   I clicked on Cancel Invoices Button
60 -
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"), })
65
66 -
67   I check that customer invoice is in the cancel state
68 -
69   !assert {model: account.invoice, id: account_invoice_state}:
70     - state == 'cancel'
71