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
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
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 company_id: base.main_company
22 - account_id: account.a_sale
23 name: '[PC-DEM] PC on Demand'
26 product_id: product.product_product_5
27 uos_id: product.product_uom_unit
28 journal_id: account.sales_journal
29 partner_id: base.res_partner_3
33 - I create the invoice, as I clicked on the "Create" button
34 - !workflow {model: account.invoice, action: invoice_open, ref: invoice_seq_test}
36 - I check that the invoice state is "Open"
37 - !assert {model: account.invoice, id: invoice_seq_test}:
40 - I check that the invoice got the right number using our sequence
41 # This used to fail because of bug #602188
42 - !assert {model: account.invoice, id: invoice_seq_test}:
43 - number == 'FY-042-TEST'