Merge lp:~pedro.baeza/openupgrade-addons/7.0-stock_location into lp:openupgrade-addons

Proposed by Pedro Manuel Baeza
Status: Merged
Merged at revision: 8169
Proposed branch: lp:~pedro.baeza/openupgrade-addons/7.0-stock_location
Merge into: lp:openupgrade-addons
Diff against target: 83 lines (+69/-0)
3 files modified
stock_location/migrations/7.0.1.0/openupgrade_analysis_work.txt (+5/-0)
stock_location/migrations/7.0.1.0/post-migration.py (+32/-0)
stock_location/migrations/7.0.1.0/pre-migration.py (+32/-0)
To merge this branch: bzr merge lp:~pedro.baeza/openupgrade-addons/7.0-stock_location
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Review via email: mp+231396@code.launchpad.net

Description of the change

Migration scripts and work file for stock_location.

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Can anyone check this?

Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

LGTM. Thanks.

review: Approve (code review, no test)
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'stock_location/migrations/7.0.1.0/openupgrade_analysis_work.txt'
2--- stock_location/migrations/7.0.1.0/openupgrade_analysis_work.txt 1970-01-01 00:00:00 +0000
3+++ stock_location/migrations/7.0.1.0/openupgrade_analysis_work.txt 2014-08-19 15:59:24 +0000
4@@ -0,0 +1,5 @@
5+---Fields in module 'stock_location'---
6+stock_location / product.pulled.flow / partner_address_id (many2one) : relation is now 'res.partner' ('res.partner.address')
7+=> Handled on migration script. OK.
8+
9+---XML records in module 'stock_location'---
10
11=== added file 'stock_location/migrations/7.0.1.0/post-migration.py'
12--- stock_location/migrations/7.0.1.0/post-migration.py 1970-01-01 00:00:00 +0000
13+++ stock_location/migrations/7.0.1.0/post-migration.py 2014-08-19 15:59:24 +0000
14@@ -0,0 +1,32 @@
15+# -*- coding: utf-8 -*-
16+##############################################################################
17+#
18+# OpenERP, Open Source Management Solution
19+#
20+# This program is free software: you can redistribute it and/or modify
21+# it under the terms of the GNU Affero General Public License as
22+# published by the Free Software Foundation, either version 3 of the
23+# License, or (at your option) any later version.
24+#
25+# This program is distributed in the hope that it will be useful,
26+# but WITHOUT ANY WARRANTY; without even the implied warranty of
27+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28+# GNU Affero General Public License for more details.
29+#
30+# You should have received a copy of the GNU Affero General Public License
31+# along with this program. If not, see <http://www.gnu.org/licenses/>.
32+#
33+##############################################################################
34+
35+from openerp import pooler
36+from openerp.openupgrade import openupgrade, openupgrade_70
37+
38+def migrate_partners(cr, pool):
39+ openupgrade_70.set_partner_id_from_partner_address_id(
40+ cr, pool, 'product.pulled.flow',
41+ 'partner_address_id', openupgrade.get_legacy_name('partner_address_id'))
42+
43+@openupgrade.migrate()
44+def migrate(cr, version):
45+ pool = pooler.get_pool(cr.dbname)
46+ migrate_partners(cr, pool)
47
48=== added file 'stock_location/migrations/7.0.1.0/pre-migration.py'
49--- stock_location/migrations/7.0.1.0/pre-migration.py 1970-01-01 00:00:00 +0000
50+++ stock_location/migrations/7.0.1.0/pre-migration.py 2014-08-19 15:59:24 +0000
51@@ -0,0 +1,32 @@
52+# -*- coding: utf-8 -*-
53+##############################################################################
54+#
55+# OpenERP, Open Source Management Solution
56+#
57+# This program is free software: you can redistribute it and/or modify
58+# it under the terms of the GNU Affero General Public License as
59+# published by the Free Software Foundation, either version 3 of the
60+# License, or (at your option) any later version.
61+#
62+# This program is distributed in the hope that it will be useful,
63+# but WITHOUT ANY WARRANTY; without even the implied warranty of
64+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65+# GNU Affero General Public License for more details.
66+#
67+# You should have received a copy of the GNU Affero General Public License
68+# along with this program. If not, see <http://www.gnu.org/licenses/>.
69+#
70+##############################################################################
71+
72+from openerp.openupgrade import openupgrade
73+
74+column_renames = {
75+ # Using magic None value to trigger call to get_legacy_name()
76+ 'product_pulled_flow':[
77+ ('partner_address_id', None),
78+ ],
79+}
80+
81+@openupgrade.migrate()
82+def migrate(cr, version):
83+ openupgrade.rename_columns(cr, column_renames)

Subscribers

People subscribed via source and target branches