← Back to team overview

credativ team mailing list archive

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

 

Holger Brunn (Therp) has proposed merging lp:~therp-nl/openupgrade-addons/6.1-nothing_to_do into lp:openupgrade-addons.

Requested reviews:
  OpenUpgrade Committers (openupgrade-committers)

For more details, see:
https://code.launchpad.net/~therp-nl/openupgrade-addons/6.1-nothing_to_do/+merge/109807
-- 
https://code.launchpad.net/~therp-nl/openupgrade-addons/6.1-nothing_to_do/+merge/109807
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~therp-nl/openupgrade-addons/6.1-nothing_to_do into lp:openupgrade-addons.
=== added file 'account_analytic_analysis/migrations/6.1.1.1/user_notes.txt'
--- account_analytic_analysis/migrations/6.1.1.1/user_notes.txt	1970-01-01 00:00:00 +0000
+++ account_analytic_analysis/migrations/6.1.1.1/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'account_analytic_analysis'

=== added file 'account_analytic_default/migrations/6.1.1.0/user_notes.txt'
--- account_analytic_default/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ account_analytic_default/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'account_analytic_default'

=== added file 'account_analytic_plans/migrations/6.1.1.0/user_notes.txt'
--- account_analytic_plans/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ account_analytic_plans/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'account_analytic_plans'

=== added file 'account_budget/migrations/6.1.1.0/user_notes.txt'
--- account_budget/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ account_budget/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'account_budget'

=== added file 'analytic_user_function/migrations/6.1.1.0/user_notes.txt'
--- analytic_user_function/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ analytic_user_function/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for 'analytic_user_function'

=== added file 'audittrail/migrations/6.1.1.0/user_notes.txt'
--- audittrail/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ audittrail/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'audittrail'

=== added file 'base_setup/migrations/6.1.1.0/user_notes.txt'
--- base_setup/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ base_setup/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'base_setup'

=== modified file 'hr/migrations/6.1.1.1/post-migration.py'
--- hr/migrations/6.1.1.1/post-migration.py	2012-06-08 09:18:00 +0000
+++ hr/migrations/6.1.1.1/post-migration.py	2012-06-12 11:12:19 +0000
@@ -8,30 +8,65 @@
 @openupgrade.migrate()
 def migrate(cr, version):
     pool = pooler.get_pool(cr.dbname)
-    #null values of the many2one are reset to first value in the selection, restore the null values
-    cr.execute('update hr_employee set marital=NULL where openupgrade_legacy_marital is NULL')
-    #get possible marital states and if in the original many2one, update selection field
+    #null values of the many2one are reset to first value in the selection, 
+    #restore the null values
+    cr.execute('update hr_employee set marital=NULL where '+
+        openupgrade.get_legacy_name('marital')+' is NULL')
+    #get possible marital states and if in the original many2one, update 
+    #selection field
     marital_states={}
-    for (marital_state,marital_state_name)  in pool.get('hr.employee')._columns['marital'].selection:
+    for (marital_state,marital_state_name) in pool.get('hr.employee')._columns['marital'].selection:
         cr.execute(
-                'update hr_employee set marital=%(marital_state)s where openupgrade_legacy_marital in'+
-                '(select id from openupgrade_legacy_hr_employee_marital_status where lower(name) in %(marital_states)s)',
-                {'marital_state': marital_state, 'marital_states': tuple([marital_state.lower(),marital_state_name.lower()])})
+            'update hr_employee set marital=%(marital_state)s where '+
+            openupgrade.get_legacy_name('marital')+' in'+
+            '(select id from '+
+            openupgrade.get_legacy_name('hr_employee_marital_status')+
+            ' where lower(name) in %(marital_states)s)',            
+            {
+                'marital_state': marital_state, 
+                'marital_states': 
+                    tuple([marital_state.lower(),marital_state_name.lower()])
+            })
         marital_states[marital_state]=marital_state_name
         
     #get marital states not included in the selection
-    cr.execute('select id from hr_employee where openupgrade_legacy_marital is not null and openupgrade_legacy_marital not in '+
-            '(select id from openupgrade_legacy_hr_employee_marital_status where lower(name) in %(marital_states)s)',
-            {'marital_states': tuple([v.lower() for v in marital_states.itervalues()]+[k.lower() for k in marital_states.iterkeys()])})
+    cr.execute(
+        'select id from hr_employee where '+
+        openupgrade.get_legacy_name('marital')+' is not null and '+
+        openupgrade.get_legacy_name('marital')+' not in '+
+        '(select id from '+
+            openupgrade.get_legacy_name('hr_employee_marital_status')+
+            ' where lower(name) in %(marital_states)s)',
+        {
+            'marital_states': 
+                tuple(
+                    [v.lower() for v in marital_states.itervalues()]+
+                    [k.lower() for k in marital_states.iterkeys()])
+        })
     if cr.rowcount:
-        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()])
+        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()])
     else:
         logger.info('all values of hr_employee_marital_status are in the selection')
-        openupgrade.drop_columns(cr, [('hr_employee', 'openupgrade_legacy_marital')])
-        cr.execute('drop table openupgrade_legacy_hr_employee_marital_status')
+        openupgrade.drop_columns(
+            cr, 
+            [('hr_employee', 
+                openupgrade.get_legacy_name('marital'))])
+        cr.execute('drop table '+
+            openupgrade.get_legacy_name('hr_employee_marital_status'))
 
     #fields have been calculated already
-    cr.execute('update hr_job set no_of_recruitment=openupgrade_legacy_expected_employees-no_of_employee')
+    cr.execute(
+        'update hr_job set no_of_recruitment='+
+        openupgrade.get_legacy_name('expected_employees')+
+        '-no_of_employee')
     #recalculate expectred employees
-    cr.execute('update hr_job set expected_employees=no_of_recruitment+no_of_employee')
-    openupgrade.drop_columns(cr, [('hr_job', 'openupgrade_legacy_expected_employees')])
+    cr.execute(
+        'update hr_job set expected_employees=no_of_recruitment+no_of_employee')
+    openupgrade.drop_columns(
+            cr, 
+            [(
+                'hr_job', 
+                openupgrade.get_legacy_name('expected_employees')
+            )])

=== modified file 'hr/migrations/6.1.1.1/pre-migration.py'
--- hr/migrations/6.1.1.1/pre-migration.py	2012-06-07 13:13:15 +0000
+++ hr/migrations/6.1.1.1/pre-migration.py	2012-06-12 11:12:19 +0000
@@ -4,15 +4,15 @@
 
 @openupgrade.migrate()
 def migrate(cr, version):
-    openupgrade.rename_tables(cr, [('hr_employee_marital_status', 'openupgrade_legacy_hr_employee_marital_status')])
+    openupgrade.rename_tables(cr, [('hr_employee_marital_status', openupgrade.get_legacy_name('hr_employee_marital_status'))])
     openupgrade.rename_columns(cr, 
             {
                 'hr_employee': 
                 [
-                    ('marital', 'openupgrade_legacy_marital'), 
+                    ('marital', openupgrade.get_legacy_name('marital')), 
                 ],
                 'hr_job': 
                 [
-                    ('expected_employees', 'openupgrade_legacy_expected_employees')
+                    ('expected_employees', openupgrade.get_legacy_name('expected_employees'))
                 ],
             })

=== modified file 'hr/migrations/6.1.1.1/user_notes.txt'
--- hr/migrations/6.1.1.1/user_notes.txt	2012-06-08 13:03:40 +0000
+++ hr/migrations/6.1.1.1/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -1,2 +1,2 @@
-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.
+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.
 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.

=== added file 'hr_attendance/migrations/6.1.1.1/user_notes.txt'
--- hr_attendance/migrations/6.1.1.1/user_notes.txt	1970-01-01 00:00:00 +0000
+++ hr_attendance/migrations/6.1.1.1/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'hr_attendance'

=== added file 'hr_contract/migrations/6.1.1.0/pre-migrate.py'
--- hr_contract/migrations/6.1.1.0/pre-migrate.py	1970-01-01 00:00:00 +0000
+++ hr_contract/migrations/6.1.1.0/pre-migrate.py	2012-06-12 11:12:19 +0000
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+from openerp.openupgrade import openupgrade
+
+#@openupgrade.migrate()
+def migrate(cr, version):
+    openupgrade.rename_columns(
+      cr,
+      {
+        'hr_contract':
+        [
+          ('advantages_gross', openupgrade.get_legacy_name('advantages_gross')),
+          ('advantages_net', openupgrade.get_legacy_name('advantages_net'))
+        ]
+      })

=== added file 'hr_contract/migrations/6.1.1.0/user_notes.txt'
--- hr_contract/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ hr_contract/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,15 @@
+Gross and net advantages have been dropped and incorporated into the more
+general framework of hr_payroll.
+
+The values of those fields have been evacuated to
+openupgrade_legacy_6_1_0_final_0_advantages_net
+openupgrade_legacy_6_1_0_final_0_advantages_gross
+
+If you want to add them to the notes field, run following query:
+---
+update hr_contract set notes=
+coalesce(notes||E'\n', '') || 'gross advantages: ' || 
+coalesce(cast(openupgrade_legacy_6_1_0_final_0_advantages_gross as varchar), '') 
+|| E'\nnet advantages: ' || 
+coalesce(cast(openupgrade_legacy_6_1_0_final_0_advantages_net as varchar), '');
+---

=== added file 'hr_expense/migrations/6.1.1.0/user_notes.txt'
--- hr_expense/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ hr_expense/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'hr_expense'

=== added file 'hr_timesheet/migrations/6.1.1.0/user_notes.txt'
--- hr_timesheet/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ hr_timesheet/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'hr_timesheet'

=== added file 'hr_timesheet_invoice/migrations/6.1.1.0/user_notes.txt'
--- hr_timesheet_invoice/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ hr_timesheet_invoice/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'hr_timesheet_invoice'

=== added file 'hr_timesheet_sheet/migrations/6.1.1.0/pre-migrate.py'
--- hr_timesheet_sheet/migrations/6.1.1.0/pre-migrate.py	1970-01-01 00:00:00 +0000
+++ hr_timesheet_sheet/migrations/6.1.1.0/pre-migrate.py	2012-06-12 11:12:19 +0000
@@ -0,0 +1,15 @@
+import logging
+from openerp.openupgrade import openupgrade
+
+logger = logging.getLogger('OpenUpgrade')
+
+@openupgrade.migrate()
+def migrate(cr, version):
+    cr.execute("""select id, timesheet_range, name from res_company where 
+               timesheet_range='year'""")
+    for row in cr.fetchall():
+        logger.warning('%s is configured for timesheet validation per year. '+
+                       'This was deprecated so validation for %s is changed '+
+                       'to monthly.', row[2], row[2])
+    cr.execute("""update res_company set timesheet_range='month'
+               where timesheet_range='year'""")

=== added file 'hr_timesheet_sheet/migrations/6.1.1.0/user_notes.txt'
--- hr_timesheet_sheet/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ hr_timesheet_sheet/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,3 @@
+Timesheet validation per year had been dropped.
+If you used validation per year, this will be changed to validation per month
+and a warning will be issued.

=== added file 'mrp/migrations/6.1.1.1/user_notes.txt'
--- mrp/migrations/6.1.1.1/user_notes.txt	1970-01-01 00:00:00 +0000
+++ mrp/migrations/6.1.1.1/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'mrp'

=== added file 'project_timesheet/migrations/6.1.1.0/user_notes.txt'
--- project_timesheet/migrations/6.1.1.0/user_notes.txt	1970-01-01 00:00:00 +0000
+++ project_timesheet/migrations/6.1.1.0/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'project_timesheet'

=== added file 'purchase/migrations/6.1.1.1/user_notes.txt'
--- purchase/migrations/6.1.1.1/user_notes.txt	1970-01-01 00:00:00 +0000
+++ purchase/migrations/6.1.1.1/user_notes.txt	2012-06-12 11:12:19 +0000
@@ -0,0 +1,1 @@
+Nothing to do for module 'purchase'


Follow ups