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 address_contact_id: base.res_partner_address_zen
20 company_id: base.main_company
23 - account_id: account.a_sale
24 name: '[PC3] Medium PC'
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
34 - I create the invoice, as I clicked on the "Create" button
35 - !workflow {model: account.invoice, action: invoice_open, ref: invoice_seq_test}
37 - I check that the invoice state is "Open"
38 - !assert {model: account.invoice, id: invoice_seq_test}:
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'