Merge lp:~therp-nl/openupgrade-addons/6.1-nothing_to_do into lp:openupgrade-addons/6.1

Proposed by Holger Brunn (Therp)
Status: Merged
Merged at revision: 6602
Proposed branch: lp:~therp-nl/openupgrade-addons/6.1-nothing_to_do
Merge into: lp:openupgrade-addons/6.1
Diff against target: 267 lines (+116/-20)
21 files modified
account_analytic_analysis/migrations/6.1.1.1/user_notes.txt (+1/-0)
account_analytic_default/migrations/6.1.1.0/user_notes.txt (+1/-0)
account_analytic_plans/migrations/6.1.1.0/user_notes.txt (+1/-0)
account_budget/migrations/6.1.1.0/user_notes.txt (+1/-0)
analytic_user_function/migrations/6.1.1.0/user_notes.txt (+1/-0)
audittrail/migrations/6.1.1.0/user_notes.txt (+1/-0)
base_setup/migrations/6.1.1.0/user_notes.txt (+1/-0)
hr/migrations/6.1.1.1/post-migration.py (+51/-16)
hr/migrations/6.1.1.1/pre-migration.py (+3/-3)
hr/migrations/6.1.1.1/user_notes.txt (+1/-1)
hr_attendance/migrations/6.1.1.1/user_notes.txt (+1/-0)
hr_contract/migrations/6.1.1.0/pre-migrate.py (+14/-0)
hr_contract/migrations/6.1.1.0/user_notes.txt (+15/-0)
hr_expense/migrations/6.1.1.0/user_notes.txt (+1/-0)
hr_timesheet/migrations/6.1.1.0/user_notes.txt (+1/-0)
hr_timesheet_invoice/migrations/6.1.1.0/user_notes.txt (+1/-0)
hr_timesheet_sheet/migrations/6.1.1.0/pre-migrate.py (+15/-0)
hr_timesheet_sheet/migrations/6.1.1.0/user_notes.txt (+3/-0)
mrp/migrations/6.1.1.1/user_notes.txt (+1/-0)
project_timesheet/migrations/6.1.1.0/user_notes.txt (+1/-0)
purchase/migrations/6.1.1.1/user_notes.txt (+1/-0)
To merge this branch: bzr merge lp:~therp-nl/openupgrade-addons/6.1-nothing_to_do
Reviewer Review Type Date Requested Status
OpenUpgrade Committers Pending
Review via email: mp+109807@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'account_analytic_analysis/migrations/6.1.1.1/user_notes.txt'
2--- account_analytic_analysis/migrations/6.1.1.1/user_notes.txt 1970-01-01 00:00:00 +0000
3+++ account_analytic_analysis/migrations/6.1.1.1/user_notes.txt 2012-06-12 11:12:19 +0000
4@@ -0,0 +1,1 @@
5+Nothing to do for module 'account_analytic_analysis'
6
7=== added file 'account_analytic_default/migrations/6.1.1.0/user_notes.txt'
8--- account_analytic_default/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
9+++ account_analytic_default/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
10@@ -0,0 +1,1 @@
11+Nothing to do for module 'account_analytic_default'
12
13=== added file 'account_analytic_plans/migrations/6.1.1.0/user_notes.txt'
14--- account_analytic_plans/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
15+++ account_analytic_plans/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
16@@ -0,0 +1,1 @@
17+Nothing to do for module 'account_analytic_plans'
18
19=== added file 'account_budget/migrations/6.1.1.0/user_notes.txt'
20--- account_budget/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
21+++ account_budget/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
22@@ -0,0 +1,1 @@
23+Nothing to do for module 'account_budget'
24
25=== added file 'analytic_user_function/migrations/6.1.1.0/user_notes.txt'
26--- analytic_user_function/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
27+++ analytic_user_function/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
28@@ -0,0 +1,1 @@
29+Nothing to do for 'analytic_user_function'
30
31=== added file 'audittrail/migrations/6.1.1.0/user_notes.txt'
32--- audittrail/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
33+++ audittrail/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
34@@ -0,0 +1,1 @@
35+Nothing to do for module 'audittrail'
36
37=== added file 'base_setup/migrations/6.1.1.0/user_notes.txt'
38--- base_setup/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
39+++ base_setup/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
40@@ -0,0 +1,1 @@
41+Nothing to do for module 'base_setup'
42
43=== modified file 'hr/migrations/6.1.1.1/post-migration.py'
44--- hr/migrations/6.1.1.1/post-migration.py 2012-06-08 09:18:00 +0000
45+++ hr/migrations/6.1.1.1/post-migration.py 2012-06-12 11:12:19 +0000
46@@ -8,30 +8,65 @@
47 @openupgrade.migrate()
48 def migrate(cr, version):
49 pool = pooler.get_pool(cr.dbname)
50- #null values of the many2one are reset to first value in the selection, restore the null values
51- cr.execute('update hr_employee set marital=NULL where openupgrade_legacy_marital is NULL')
52- #get possible marital states and if in the original many2one, update selection field
53+ #null values of the many2one are reset to first value in the selection,
54+ #restore the null values
55+ cr.execute('update hr_employee set marital=NULL where '+
56+ openupgrade.get_legacy_name('marital')+' is NULL')
57+ #get possible marital states and if in the original many2one, update
58+ #selection field
59 marital_states={}
60- for (marital_state,marital_state_name) in pool.get('hr.employee')._columns['marital'].selection:
61+ for (marital_state,marital_state_name) in pool.get('hr.employee')._columns['marital'].selection:
62 cr.execute(
63- 'update hr_employee set marital=%(marital_state)s where openupgrade_legacy_marital in'+
64- '(select id from openupgrade_legacy_hr_employee_marital_status where lower(name) in %(marital_states)s)',
65- {'marital_state': marital_state, 'marital_states': tuple([marital_state.lower(),marital_state_name.lower()])})
66+ 'update hr_employee set marital=%(marital_state)s where '+
67+ openupgrade.get_legacy_name('marital')+' in'+
68+ '(select id from '+
69+ openupgrade.get_legacy_name('hr_employee_marital_status')+
70+ ' where lower(name) in %(marital_states)s)',
71+ {
72+ 'marital_state': marital_state,
73+ 'marital_states':
74+ tuple([marital_state.lower(),marital_state_name.lower()])
75+ })
76 marital_states[marital_state]=marital_state_name
77
78 #get marital states not included in the selection
79- cr.execute('select id from hr_employee where openupgrade_legacy_marital is not null and openupgrade_legacy_marital not in '+
80- '(select id from openupgrade_legacy_hr_employee_marital_status where lower(name) in %(marital_states)s)',
81- {'marital_states': tuple([v.lower() for v in marital_states.itervalues()]+[k.lower() for k in marital_states.iterkeys()])})
82+ cr.execute(
83+ 'select id from hr_employee where '+
84+ openupgrade.get_legacy_name('marital')+' is not null and '+
85+ openupgrade.get_legacy_name('marital')+' not in '+
86+ '(select id from '+
87+ openupgrade.get_legacy_name('hr_employee_marital_status')+
88+ ' where lower(name) in %(marital_states)s)',
89+ {
90+ 'marital_states':
91+ tuple(
92+ [v.lower() for v in marital_states.itervalues()]+
93+ [k.lower() for k in marital_states.iterkeys()])
94+ })
95 if cr.rowcount:
96- logger.warning('not all values of hr_employee_marital_status are in the selection. review hr_employee ids %s', [row[0] for row in cr.fetchall()])
97+ logger.warning('not all values of hr_employee_marital_status are in '+
98+ 'the selection. review hr_employee ids %s',
99+ [row[0] for row in cr.fetchall()])
100 else:
101 logger.info('all values of hr_employee_marital_status are in the selection')
102- openupgrade.drop_columns(cr, [('hr_employee', 'openupgrade_legacy_marital')])
103- cr.execute('drop table openupgrade_legacy_hr_employee_marital_status')
104+ openupgrade.drop_columns(
105+ cr,
106+ [('hr_employee',
107+ openupgrade.get_legacy_name('marital'))])
108+ cr.execute('drop table '+
109+ openupgrade.get_legacy_name('hr_employee_marital_status'))
110
111 #fields have been calculated already
112- cr.execute('update hr_job set no_of_recruitment=openupgrade_legacy_expected_employees-no_of_employee')
113+ cr.execute(
114+ 'update hr_job set no_of_recruitment='+
115+ openupgrade.get_legacy_name('expected_employees')+
116+ '-no_of_employee')
117 #recalculate expectred employees
118- cr.execute('update hr_job set expected_employees=no_of_recruitment+no_of_employee')
119- openupgrade.drop_columns(cr, [('hr_job', 'openupgrade_legacy_expected_employees')])
120+ cr.execute(
121+ 'update hr_job set expected_employees=no_of_recruitment+no_of_employee')
122+ openupgrade.drop_columns(
123+ cr,
124+ [(
125+ 'hr_job',
126+ openupgrade.get_legacy_name('expected_employees')
127+ )])
128
129=== modified file 'hr/migrations/6.1.1.1/pre-migration.py'
130--- hr/migrations/6.1.1.1/pre-migration.py 2012-06-07 13:13:15 +0000
131+++ hr/migrations/6.1.1.1/pre-migration.py 2012-06-12 11:12:19 +0000
132@@ -4,15 +4,15 @@
133
134 @openupgrade.migrate()
135 def migrate(cr, version):
136- openupgrade.rename_tables(cr, [('hr_employee_marital_status', 'openupgrade_legacy_hr_employee_marital_status')])
137+ openupgrade.rename_tables(cr, [('hr_employee_marital_status', openupgrade.get_legacy_name('hr_employee_marital_status'))])
138 openupgrade.rename_columns(cr,
139 {
140 'hr_employee':
141 [
142- ('marital', 'openupgrade_legacy_marital'),
143+ ('marital', openupgrade.get_legacy_name('marital')),
144 ],
145 'hr_job':
146 [
147- ('expected_employees', 'openupgrade_legacy_expected_employees')
148+ ('expected_employees', openupgrade.get_legacy_name('expected_employees'))
149 ],
150 })
151
152=== modified file 'hr/migrations/6.1.1.1/user_notes.txt'
153--- hr/migrations/6.1.1.1/user_notes.txt 2012-06-08 13:03:40 +0000
154+++ hr/migrations/6.1.1.1/user_notes.txt 2012-06-12 11:12:19 +0000
155@@ -1,2 +1,2 @@
156-Marital status has been changed (back) to be a selection. The script tries to find a suitable selection entry from the list of marital states. This will fail if you customized this list, you'll get a warning about the employee IDs with marital states not in the selection, and find the original values in column openupgrade_legacy_marital. If you customize the selection *before* the migration with the same values used in the list of martial states, this script will pick up those values too.
157+Marital status has been changed (back) to be a selection. The script tries to find a suitable selection entry from the list of marital states. This will fail if you customized this list, you'll get a warning about the employee IDs with marital states not in the selection, and find the original values in column openupgrade_6_1_1_1_legacy_marital. If you customize the selection *before* the migration with the same values used in the list of martial states, this script will pick up those values too.
158 If there are no unknown marital states (either because you didn't customize them or you put your customizations into the selection), the legacy column and the table will be dropped after migration.
159
160=== added file 'hr_attendance/migrations/6.1.1.1/user_notes.txt'
161--- hr_attendance/migrations/6.1.1.1/user_notes.txt 1970-01-01 00:00:00 +0000
162+++ hr_attendance/migrations/6.1.1.1/user_notes.txt 2012-06-12 11:12:19 +0000
163@@ -0,0 +1,1 @@
164+Nothing to do for module 'hr_attendance'
165
166=== added file 'hr_contract/migrations/6.1.1.0/pre-migrate.py'
167--- hr_contract/migrations/6.1.1.0/pre-migrate.py 1970-01-01 00:00:00 +0000
168+++ hr_contract/migrations/6.1.1.0/pre-migrate.py 2012-06-12 11:12:19 +0000
169@@ -0,0 +1,14 @@
170+# -*- coding: utf-8 -*-
171+from openerp.openupgrade import openupgrade
172+
173+#@openupgrade.migrate()
174+def migrate(cr, version):
175+ openupgrade.rename_columns(
176+ cr,
177+ {
178+ 'hr_contract':
179+ [
180+ ('advantages_gross', openupgrade.get_legacy_name('advantages_gross')),
181+ ('advantages_net', openupgrade.get_legacy_name('advantages_net'))
182+ ]
183+ })
184
185=== added file 'hr_contract/migrations/6.1.1.0/user_notes.txt'
186--- hr_contract/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
187+++ hr_contract/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
188@@ -0,0 +1,15 @@
189+Gross and net advantages have been dropped and incorporated into the more
190+general framework of hr_payroll.
191+
192+The values of those fields have been evacuated to
193+openupgrade_legacy_6_1_0_final_0_advantages_net
194+openupgrade_legacy_6_1_0_final_0_advantages_gross
195+
196+If you want to add them to the notes field, run following query:
197+---
198+update hr_contract set notes=
199+coalesce(notes||E'\n', '') || 'gross advantages: ' ||
200+coalesce(cast(openupgrade_legacy_6_1_0_final_0_advantages_gross as varchar), '')
201+|| E'\nnet advantages: ' ||
202+coalesce(cast(openupgrade_legacy_6_1_0_final_0_advantages_net as varchar), '');
203+---
204
205=== added file 'hr_expense/migrations/6.1.1.0/user_notes.txt'
206--- hr_expense/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
207+++ hr_expense/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
208@@ -0,0 +1,1 @@
209+Nothing to do for module 'hr_expense'
210
211=== added file 'hr_timesheet/migrations/6.1.1.0/user_notes.txt'
212--- hr_timesheet/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
213+++ hr_timesheet/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
214@@ -0,0 +1,1 @@
215+Nothing to do for module 'hr_timesheet'
216
217=== added file 'hr_timesheet_invoice/migrations/6.1.1.0/user_notes.txt'
218--- hr_timesheet_invoice/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
219+++ hr_timesheet_invoice/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
220@@ -0,0 +1,1 @@
221+Nothing to do for module 'hr_timesheet_invoice'
222
223=== added file 'hr_timesheet_sheet/migrations/6.1.1.0/pre-migrate.py'
224--- hr_timesheet_sheet/migrations/6.1.1.0/pre-migrate.py 1970-01-01 00:00:00 +0000
225+++ hr_timesheet_sheet/migrations/6.1.1.0/pre-migrate.py 2012-06-12 11:12:19 +0000
226@@ -0,0 +1,15 @@
227+import logging
228+from openerp.openupgrade import openupgrade
229+
230+logger = logging.getLogger('OpenUpgrade')
231+
232+@openupgrade.migrate()
233+def migrate(cr, version):
234+ cr.execute("""select id, timesheet_range, name from res_company where
235+ timesheet_range='year'""")
236+ for row in cr.fetchall():
237+ logger.warning('%s is configured for timesheet validation per year. '+
238+ 'This was deprecated so validation for %s is changed '+
239+ 'to monthly.', row[2], row[2])
240+ cr.execute("""update res_company set timesheet_range='month'
241+ where timesheet_range='year'""")
242
243=== added file 'hr_timesheet_sheet/migrations/6.1.1.0/user_notes.txt'
244--- hr_timesheet_sheet/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
245+++ hr_timesheet_sheet/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
246@@ -0,0 +1,3 @@
247+Timesheet validation per year had been dropped.
248+If you used validation per year, this will be changed to validation per month
249+and a warning will be issued.
250
251=== added file 'mrp/migrations/6.1.1.1/user_notes.txt'
252--- mrp/migrations/6.1.1.1/user_notes.txt 1970-01-01 00:00:00 +0000
253+++ mrp/migrations/6.1.1.1/user_notes.txt 2012-06-12 11:12:19 +0000
254@@ -0,0 +1,1 @@
255+Nothing to do for module 'mrp'
256
257=== added file 'project_timesheet/migrations/6.1.1.0/user_notes.txt'
258--- project_timesheet/migrations/6.1.1.0/user_notes.txt 1970-01-01 00:00:00 +0000
259+++ project_timesheet/migrations/6.1.1.0/user_notes.txt 2012-06-12 11:12:19 +0000
260@@ -0,0 +1,1 @@
261+Nothing to do for module 'project_timesheet'
262
263=== added file 'purchase/migrations/6.1.1.1/user_notes.txt'
264--- purchase/migrations/6.1.1.1/user_notes.txt 1970-01-01 00:00:00 +0000
265+++ purchase/migrations/6.1.1.1/user_notes.txt 2012-06-12 11:12:19 +0000
266@@ -0,0 +1,1 @@
267+Nothing to do for module 'purchase'

Subscribers

People subscribed via source and target branches