Merge lp:~acsone-openerp/openobject-addons/7.0-bug-1281579-sbi into lp:openobject-addons/7.0

Proposed by Stéphane Bidoul (Acsone)
Status: Needs review
Proposed branch: lp:~acsone-openerp/openobject-addons/7.0-bug-1281579-sbi
Merge into: lp:openobject-addons/7.0
Diff against target: 123 lines (+21/-12)
1 file modified
account/demo/account_demo.xml (+21/-12)
To merge this branch: bzr merge lp:~acsone-openerp/openobject-addons/7.0-bug-1281579-sbi
Reviewer Review Type Date Requested Status
qdp (OpenERP) Disapprove
Alex Comba - Agile BG (community) Approve
Laurent Mignon (Acsone) (community) code review, tested Approve
Nicolas Bessi - Camptocamp (community) Approve
Review via email: mp+207311@code.launchpad.net

Description of the change

In the account module demo data, the periods have all the special flag set to True, which is not a normal configuration for fiscal periods. In addition, there is no real opening period.

The present MP creates a proper opening period and set the special flag to False in all other periods in demo data.

This branch is green on runbot.

To post a comment you must log in.
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

LGTM

review: Approve
Revision history for this message
Laurent Mignon (Acsone) (lmi) wrote :

LGTM

review: Approve (code review, tested)
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Fore the record, this has been discussed previously in https://bugs.launchpad.net/openobject-addons/+bug/924200.

However, I believe the time is now right to merge this, as
- it facilitates the creation of test suites that require proper fiscal period configurations,
- the branch is green on runbot

Revision history for this message
Alex Comba - Agile BG (tafaru) wrote :

LGTM

review: Approve
Revision history for this message
qdp (OpenERP) (qdp) wrote :

if i'm not wrong, this will prevent installing any localization module for the main company if the demo data is installed as well because it will crash saying that periods cannot overlap.

This is the reason of the special flag set to True on all demo periods, and although i agree it's not convenient/clean... this patch won't keep this behavior.

So, for me the patch is breaking more than it is bringing. :-s

review: Disapprove
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hello Quentin,

Thanks for commenting on this one.

I just did the following test:
- create database with demo data
- install accounting module
- select belgian localization

and I encountered no issue.

Can you elaborate the specific scenario which would break?

Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

Quentin any news on this one?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/demo/account_demo.xml'
2--- account/demo/account_demo.xml 2013-03-14 14:53:37 +0000
3+++ account/demo/account_demo.xml 2014-02-19 21:47:10 +0000
4@@ -18,10 +18,19 @@
5 Fiscal Periods
6 -->
7
8+ <record id="period_0" model="account.period">
9+ <field eval="'00/'+time.strftime('%Y')" name="code"/>
10+ <field eval="'X 00/'+time.strftime('%Y')" name="name"/>
11+ <field eval="True" name="special"/>
12+ <field name="fiscalyear_id" ref="data_fiscalyear"/>
13+ <field eval="time.strftime('%Y')+'-01-01'" name="date_start"/>
14+ <field eval="time.strftime('%Y')+'-01-01'" name="date_stop"/>
15+ <field name="company_id" ref="base.main_company"/>
16+ </record>
17 <record id="period_1" model="account.period">
18 <field eval="'01/'+time.strftime('%Y')" name="code"/>
19 <field eval="'X 01/'+time.strftime('%Y')" name="name"/>
20- <field eval="True" name="special"/>
21+ <field eval="False" name="special"/>
22 <field name="fiscalyear_id" ref="data_fiscalyear"/>
23 <field eval="time.strftime('%Y')+'-01-01'" name="date_start"/>
24 <field eval="time.strftime('%Y')+'-01-31'" name="date_stop"/>
25@@ -30,7 +39,7 @@
26 <record id="period_2" model="account.period">
27 <field eval="'02/'+time.strftime('%Y')" name="code"/>
28 <field eval="'X 02/'+time.strftime('%Y')" name="name"/>
29- <field eval="True" name="special"/>
30+ <field eval="False" name="special"/>
31 <field name="fiscalyear_id" ref="data_fiscalyear"/>
32 <field eval="time.strftime('%Y')+'-02-01'" name="date_start"/>
33 <!-- for the last day of February, we have to compute the day before March 1st -->
34@@ -40,7 +49,7 @@
35 <record id="period_3" model="account.period">
36 <field eval="'03/'+time.strftime('%Y')" name="code"/>
37 <field eval="'X 03/'+time.strftime('%Y')" name="name"/>
38- <field eval="True" name="special"/>
39+ <field eval="False" name="special"/>
40 <field name="fiscalyear_id" ref="data_fiscalyear"/>
41 <field eval="time.strftime('%Y')+'-03-01'" name="date_start"/>
42 <field eval="time.strftime('%Y')+'-03-31'" name="date_stop"/>
43@@ -49,7 +58,7 @@
44 <record id="period_4" model="account.period">
45 <field eval="'04/'+time.strftime('%Y')" name="code"/>
46 <field eval="'X 04/'+time.strftime('%Y')" name="name"/>
47- <field eval="True" name="special"/>
48+ <field eval="False" name="special"/>
49 <field name="fiscalyear_id" ref="data_fiscalyear"/>
50 <field eval="time.strftime('%Y')+'-04-01'" name="date_start"/>
51 <field eval="time.strftime('%Y')+'-04-30'" name="date_stop"/>
52@@ -58,7 +67,7 @@
53 <record id="period_5" model="account.period">
54 <field eval="'05/'+time.strftime('%Y')" name="code"/>
55 <field eval="'X 05/'+time.strftime('%Y')" name="name"/>
56- <field eval="True" name="special"/>
57+ <field eval="False" name="special"/>
58 <field name="fiscalyear_id" ref="data_fiscalyear"/>
59 <field eval="time.strftime('%Y')+'-05-01'" name="date_start"/>
60 <field eval="time.strftime('%Y')+'-05-31'" name="date_stop"/>
61@@ -68,7 +77,7 @@
62 <field eval="'06/'+time.strftime('%Y')" name="code"/>
63 <field eval="'X 06/'+time.strftime('%Y')" name="name"/>
64 <field name="fiscalyear_id" ref="data_fiscalyear"/>
65- <field eval="True" name="special"/>
66+ <field eval="False" name="special"/>
67 <field eval="time.strftime('%Y')+'-06-01'" name="date_start"/>
68 <field eval="time.strftime('%Y')+'-06-30'" name="date_stop"/>
69 <field name="company_id" ref="base.main_company"/>
70@@ -76,7 +85,7 @@
71 <record id="period_7" model="account.period">
72 <field eval="'07/'+time.strftime('%Y')" name="code"/>
73 <field eval="'X 07/'+time.strftime('%Y')" name="name"/>
74- <field eval="True" name="special"/>
75+ <field eval="False" name="special"/>
76 <field name="fiscalyear_id" ref="data_fiscalyear"/>
77 <field eval="time.strftime('%Y')+'-07-01'" name="date_start"/>
78 <field eval="time.strftime('%Y')+'-07-31'" name="date_stop"/>
79@@ -85,7 +94,7 @@
80 <record id="period_8" model="account.period">
81 <field eval="'08/'+time.strftime('%Y')" name="code"/>
82 <field eval="'X 08/'+time.strftime('%Y')" name="name"/>
83- <field eval="True" name="special"/>
84+ <field eval="False" name="special"/>
85 <field name="fiscalyear_id" ref="data_fiscalyear"/>
86 <field eval="time.strftime('%Y')+'-08-01'" name="date_start"/>
87 <field eval="time.strftime('%Y')+'-08-31'" name="date_stop"/>
88@@ -94,7 +103,7 @@
89 <record id="period_9" model="account.period">
90 <field eval="'09/'+time.strftime('%Y')" name="code"/>
91 <field eval="'X 09/'+time.strftime('%Y')" name="name"/>
92- <field eval="True" name="special"/>
93+ <field eval="False" name="special"/>
94 <field name="fiscalyear_id" ref="data_fiscalyear"/>
95 <field eval="time.strftime('%Y')+'-09-01'" name="date_start"/>
96 <field eval="time.strftime('%Y')+'-09-30'" name="date_stop"/>
97@@ -103,7 +112,7 @@
98 <record id="period_10" model="account.period">
99 <field eval="'10/'+time.strftime('%Y')" name="code"/>
100 <field eval="'X 10/'+time.strftime('%Y')" name="name"/>
101- <field eval="True" name="special"/>
102+ <field eval="False" name="special"/>
103 <field name="fiscalyear_id" ref="data_fiscalyear"/>
104 <field eval="time.strftime('%Y')+'-10-01'" name="date_start"/>
105 <field eval="time.strftime('%Y')+'-10-31'" name="date_stop"/>
106@@ -112,7 +121,7 @@
107 <record id="period_11" model="account.period">
108 <field eval="'11/'+time.strftime('%Y')" name="code"/>
109 <field eval="'X 11/'+time.strftime('%Y')" name="name"/>
110- <field eval="True" name="special"/>
111+ <field eval="False" name="special"/>
112 <field name="fiscalyear_id" ref="data_fiscalyear"/>
113 <field eval="time.strftime('%Y')+'-11-01'" name="date_start"/>
114 <field eval="time.strftime('%Y')+'-11-30'" name="date_stop"/>
115@@ -121,7 +130,7 @@
116 <record id="period_12" model="account.period">
117 <field eval="'12/'+time.strftime('%Y')" name="code"/>
118 <field eval="'X 12/'+time.strftime('%Y')" name="name"/>
119- <field eval="True" name="special"/>
120+ <field eval="False" name="special"/>
121 <field name="fiscalyear_id" ref="data_fiscalyear"/>
122 <field eval="time.strftime('%Y')+'-12-01'" name="date_start"/>
123 <field eval="time.strftime('%Y')+'-12-31'" name="date_stop"/>