credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #06025
[Merge] lp:~pedro.baeza/openupgrade-addons/7.0-stock_location into lp:openupgrade-addons
Pedro Manuel Baeza has proposed merging lp:~pedro.baeza/openupgrade-addons/7.0-stock_location into lp:openupgrade-addons.
Requested reviews:
OpenUpgrade Committers (openupgrade-committers)
For more details, see:
https://code.launchpad.net/~pedro.baeza/openupgrade-addons/7.0-stock_location/+merge/231396
Migration scripts and work file for stock_location.
--
https://code.launchpad.net/~pedro.baeza/openupgrade-addons/7.0-stock_location/+merge/231396
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~pedro.baeza/openupgrade-addons/7.0-stock_location into lp:openupgrade-addons.
=== added file 'stock_location/migrations/7.0.1.0/openupgrade_analysis_work.txt'
--- stock_location/migrations/7.0.1.0/openupgrade_analysis_work.txt 1970-01-01 00:00:00 +0000
+++ stock_location/migrations/7.0.1.0/openupgrade_analysis_work.txt 2014-08-19 15:26:25 +0000
@@ -0,0 +1,5 @@
+---Fields in module 'stock_location'---
+stock_location / product.pulled.flow / partner_address_id (many2one) : relation is now 'res.partner' ('res.partner.address')
+=> Handled on migration script. OK.
+
+---XML records in module 'stock_location'---
=== added file 'stock_location/migrations/7.0.1.0/post-migration.py'
--- stock_location/migrations/7.0.1.0/post-migration.py 1970-01-01 00:00:00 +0000
+++ stock_location/migrations/7.0.1.0/post-migration.py 2014-08-19 15:26:25 +0000
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2013 Sylvain LE GAL
+#
+# 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 import pooler
+from openerp.openupgrade import openupgrade, openupgrade_70
+
+def migrate_partners(cr, pool):
+ openupgrade_70.set_partner_id_from_partner_address_id(
+ cr, pool, 'product.pulled.flow',
+ 'partner_address_id', openupgrade.get_legacy_name('partner_address_id'))
+
+@openupgrade.migrate()
+def migrate(cr, version):
+ pool = pooler.get_pool(cr.dbname)
+ migrate_partners(cr, pool)
=== added file 'stock_location/migrations/7.0.1.0/pre-migration.py'
--- stock_location/migrations/7.0.1.0/pre-migration.py 1970-01-01 00:00:00 +0000
+++ stock_location/migrations/7.0.1.0/pre-migration.py 2014-08-19 15:26:25 +0000
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# This module copyright (C) 2013 Sylvain LE GAL
+#
+# 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
+
+column_renames = {
+ # Using magic None value to trigger call to get_legacy_name()
+ 'product_pulled_flow':[
+ ('partner_address_id', None),
+ ],
+}
+
+@openupgrade.migrate()
+def migrate(cr, version):
+ openupgrade.rename_columns(cr, column_renames)
Follow ups