[IMP] account: remove invoice addresss
[odoo/odoo.git] / addons / account / test / account_sequence_test.yml
1 - In order to test the invoice numbering, I create a sequence for out invoices.
2 - !record {model: ir.sequence, id: seq_out_invoice_test}:
3     name: Account Invoice Out for the demonstration Fiscal Year # XXX indicate the name of the fiscal year
4     code: account.invoice.out_invoice
5     padding: 3
6     prefix: FY-
7     suffix: -TEST
8     number_next: 42
9
10 - I link the new sequence to the demo sequence and the demo fiscal years.
11 - !record {model: account.sequence.fiscalyear, id: seq_out_invoice_test_fy}:
12     sequence_id: seq_out_invoice_test
13     sequence_main_id: seq_out_invoice
14     fiscalyear_id: data_fiscalyear
15
16 - I create a draft customer invoice in a period of the demo fiscal year
17 - !record {model: account.invoice, id: invoice_seq_test}:
18     account_id: account.a_recv
19     address_contact_id: base.res_partner_address_zen
20     company_id: base.main_company
21     currency_id: base.EUR
22     invoice_line:
23       - account_id: account.a_sale
24         name: '[PC3] Medium PC'
25         price_unit: 900.0
26         quantity: 10.0
27         product_id: product.product_product_pc3
28         uos_id: product.product_uom_unit
29     journal_id: account.sales_journal
30     partner_id: base.res_partner_3
31     reference_type: none
32     period_id: period_1
33     
34 - I create the invoice, as I clicked on the "Create" button
35 - !workflow {model: account.invoice, action: invoice_open, ref: invoice_seq_test}
36
37 - I check that the invoice state is "Open"
38 - !assert {model: account.invoice, id: invoice_seq_test}:
39     - state == 'open'
40     
41 - I check that the invoice got the right number using our sequence
42   # This used to fail because of bug #602188
43 - !assert {model: account.invoice, id: invoice_seq_test}:
44     - number == 'FY-042-TEST'