← Back to team overview

credativ team mailing list archive

lp:~therp-nl/openupgrade-addons/6.1-lp1068554-swap_employee_category_rel_columns into lp:openupgrade-addons

 

Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/openupgrade-addons/6.1-lp1068554-swap_employee_category_rel_columns into lp:openupgrade-addons.

Requested reviews:
  OpenUpgrade Committers (openupgrade-committers)
Related bugs:
  Bug #1068554 in OpenUpgrade Addons: "[6.1] Employee categories mangled"
  https://bugs.launchpad.net/openupgrade-addons/+bug/1068554

For more details, see:
https://code.launchpad.net/~therp-nl/openupgrade-addons/6.1-lp1068554-swap_employee_category_rel_columns/+merge/130517
-- 
https://code.launchpad.net/~therp-nl/openupgrade-addons/6.1-lp1068554-swap_employee_category_rel_columns/+merge/130517
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~therp-nl/openupgrade-addons/6.1-lp1068554-swap_employee_category_rel_columns into lp:openupgrade-addons.
=== modified file 'hr/migrations/6.1.1.1/pre-migration.py'
--- hr/migrations/6.1.1.1/pre-migration.py	2012-06-19 09:34:23 +0000
+++ hr/migrations/6.1.1.1/pre-migration.py	2012-10-19 10:08:24 +0000
@@ -23,6 +23,16 @@
 
 @openupgrade.migrate()
 def migrate(cr, version):
+
+    openupgrade.rename_columns(cr, {
+            # many2many table square dance
+            'employee_category_rel': [
+                ('emp_id', 'emp_id_tmp'),
+                ('category_id', 'emp_id'),
+                ('emp_id_tmp', 'category_id'),
+                ],
+            })
+
     openupgrade.rename_tables(cr, [('hr_employee_marital_status', openupgrade.get_legacy_name('hr_employee_marital_status'))])
     openupgrade.rename_columns(cr, 
             {

=== added file 'hr_timesheet_sheet/migrations/6.1.1.0/data.xml'
--- hr_timesheet_sheet/migrations/6.1.1.0/data.xml	1970-01-01 00:00:00 +0000
+++ hr_timesheet_sheet/migrations/6.1.1.0/data.xml	2012-10-19 10:08:24 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" ?>
+<openerp>
+    <data noupdate="1">
+        <!-- OpenUpgrade: overwrite the original code definition
+        from 6.0 that still has the ids argument -->
+        <record id="ir_actions_server_timsheet_sheet" model="ir.actions.server">
+            <field eval="&quot;&quot;&quot;action = pool.get('hr.timesheet.current.open').open_timesheet(cr, uid, None, context)&quot;&quot;&quot;" name="code"/>
+        </record>
+    </data>
+</openerp>

=== added file 'hr_timesheet_sheet/migrations/6.1.1.0/post-migrate.py'
--- hr_timesheet_sheet/migrations/6.1.1.0/post-migrate.py	1970-01-01 00:00:00 +0000
+++ hr_timesheet_sheet/migrations/6.1.1.0/post-migrate.py	2012-10-19 10:08:24 +0000
@@ -0,0 +1,27 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    This module copyright (C) 2012 Therp BV (<http://therp.nl>).
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU Affero General Public License as
+#    published by the Free Software Foundation, either version 3 of the
+#    License, or (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU Affero General Public License for more details.
+#
+#    You should have received a copy of the GNU Affero General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp.openupgrade import openupgrade
+
+@openupgrade.migrate
+def migrate(cr, version):
+    openupgrade.load_data(
+        cr, 'hr_timesheet_sheet', 'migrations/6.1.1.0/data.xml')


Follow ups