[REVIEW] account: correct YML of EDI
[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     address_contact_id: base.res_partner_address_3000
7     address_invoice_id: base.res_partner_address_3000
8     company_id: base.main_company
9     currency_id: base.EUR
10     invoice_line:
11       - account_id: account.a_sale
12         name: '[PC1] Basic PC'
13         price_unit: 450.0
14         quantity: 1.0
15         product_id: product.product_product_pc1
16         uos_id: product.product_uom_unit
17     journal_id: account.bank_journal
18     partner_id: base.res_partner_desertic_hispafuentes
19     reference_type: none
20 -
21   I check that Initially customer invoice state is "Draft"
22 -
23   !assert {model: account.invoice, id: account_invoice_state}:
24     - state == 'draft'
25 -
26   I called the "Confirm Draft Invoices" wizard
27 -
28   !record {model: account.invoice.confirm, id: account_invoice_confirm_0}:
29     {}
30 -
31   I clicked on Confirm Invoices Button
32 -
33   !python {model: account.invoice.confirm}: |
34     self.invoice_confirm(cr, uid, [ref("account_invoice_confirm_0")], {"lang": 'en_US',
35       "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_state")],
36       "type": "out_invoice", "active_id": ref("account_invoice_state"), })
37 -
38   I check that customer invoice state is "Open"
39 -
40   !assert {model: account.invoice, id: account_invoice_state}:
41     - state == 'open'
42 -
43   I Modified the journal record so it can cancel invoice
44 -
45   !record {model: account.journal, id: account.bank_journal}:
46     update_posted: 1
47
48
49 -
50   In order to check the "Cancel Selected Invoices" wizard in openerp I cancelled this open invoice using this wizard
51 -
52   !record {model: account.invoice.cancel, id: account_invoice_cancel_0}:
53     {}
54
55 -
56   I clicked on Cancel Invoices Button
57 -
58   !python {model: account.invoice.cancel}: |
59     self.invoice_cancel(cr, uid, [ref("account_invoice_cancel_0")], {"lang": 'en_US',
60       "tz": False, "active_model": "account.invoice", "active_ids": [ref("account_invoice_state")],
61       "type": "out_invoice", "active_id": ref("account_invoice_state"), })
62
63 -
64   I check that customer invoice is in the cancel state
65 -
66   !assert {model: account.invoice, id: account_invoice_state}:
67     - state == 'cancel'
68