Merge lp:~numerigraphe/openobject-addons/5.0-unittest into lp:openobject-addons/5.0

Proposed by Numérigraphe
Status: Superseded
Proposed branch: lp:~numerigraphe/openobject-addons/5.0-unittest
Merge into: lp:openobject-addons/5.0
Diff against target: 69 lines (+54/-0)
2 files modified
account/__terp__.py (+1/-0)
account/test/sequence_bug602188_test.xml (+53/-0)
To merge this branch: bzr merge lp:~numerigraphe/openobject-addons/5.0-unittest
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+29774@code.launchpad.net

Description of the change

Added a test file for bug #602188

To post a comment you must log in.
Revision history for this message
Numérigraphe (numerigraphe) wrote :

Still no sign of a review, is adding an XML test off topic for v5.0?
Lionel.

Unmerged revisions

2432. By Numerigraphe - Lionel Sausin <email address hidden>

[ADD] test for bug 602188: wrong invoice number sequence for fiscal year in a certain case

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/__terp__.py'
2--- account/__terp__.py 2010-04-23 13:26:04 +0000
3+++ account/__terp__.py 2010-07-13 09:01:01 +0000
4@@ -67,6 +67,7 @@
5 'demo/account_minimal.xml',
6 'test/invoice_basic_test.xml',
7 'test/invoice_bug452854_test.xml',
8+ 'test/sequence_bug602188_test.xml',
9 ],
10 'installable': True,
11 'active': False,
12
13=== added file 'account/test/sequence_bug602188_test.xml'
14--- account/test/sequence_bug602188_test.xml 1970-01-01 00:00:00 +0000
15+++ account/test/sequence_bug602188_test.xml 2010-07-13 09:01:01 +0000
16@@ -0,0 +1,53 @@
17+<?xml version="1.0" encoding="utf-8"?>
18+<openerp>
19+ <data noupdate="1">
20+ <!--
21+ Make sure bug #602188 is fixed: Wrong invoice number sequence for
22+ fiscal year in a certain case
23+ -->
24+ <!-- This file must be loaded _after_ account_demo.xml ! -->
25+
26+ <!-- New invoice sequence for a fiscal year -->
27+ <record id="seq_out_invoice_bug602188" model="ir.sequence">
28+ <field eval="'Account Invoice Out for Fiscal Year '+time.strftime('%Y')"
29+ name="name" />
30+ <field name="code">account.invoice.out_invoice</field>
31+ <field name="padding" eval="3" />
32+ <field name="prefix">TEST-</field>
33+ <field name="suffix">-bug602188</field>
34+ <field name="number_next" eval="42" />
35+ <field name="active" eval="True" />
36+ </record>
37+ <record id="seq_out_invoice_bug602188_fy" model="account.sequence.fiscalyear">
38+ <field name="sequence_id" ref="seq_out_invoice_bug602188" />
39+ <field name="sequence_main_id" ref="seq_out_invoice" />
40+ <field name="fiscalyear_id" ref="data_fiscalyear" />
41+ </record>
42+
43+ <!-- New invoice using the sequence -->
44+ <record id="invoice_bug602188" model="account.invoice">
45+ <field name="currency_id" ref="base.EUR" />
46+ <field name="company_id" ref="base.main_company" />
47+ <field name="address_invoice_id" ref="base.res_partner_address_tang" />
48+ <field name="partner_id" ref="base.res_partner_asus" />
49+ <field name="journal_id" ref="account.sales_journal" />
50+ <field name="state">draft</field>
51+ <field name="type">out_invoice</field>
52+ <field name="account_id" ref="account.a_recv" />
53+ <field name="name">lp:602188</field>
54+ <field name="address_contact_id" ref="base.res_partner_address_tang" />
55+ <field name="period_id" ref="period_1" />
56+ </record>
57+ <workflow action="invoice_open" model="account.invoice" ref="invoice_bug602188" />
58+ <assert id="invoice_bug602188" model="account.invoice" severity="error"
59+ string="Invoice lp:602188 got the right number">
60+ <test expr="state">open</test>
61+ <test expr="number">TEST-042-bug602188</test>
62+ </assert>
63+
64+ <!-- Deactivate the sequence to not make other tests fail -->
65+ <record id="seq_out_invoice_bug602188" model="ir.sequence">
66+ <field name="active" eval="False" />
67+ </record>
68+ </data>
69+</openerp>