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