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
=== 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:59:24 +0000
@@ -0,0 +1,5 @@
1---Fields in module 'stock_location'---
2stock_location / product.pulled.flow / partner_address_id (many2one) : relation is now 'res.partner' ('res.partner.address')
3=> Handled on migration script. OK.
4
5---XML records in module 'stock_location'---
06
=== 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:59:24 +0000
@@ -0,0 +1,32 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as
8# published by the Free Software Foundation, either version 3 of the
9# License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Affero General Public License for more details.
15#
16# You should have received a copy of the GNU Affero General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20
21from openerp import pooler
22from openerp.openupgrade import openupgrade, openupgrade_70
23
24def migrate_partners(cr, pool):
25 openupgrade_70.set_partner_id_from_partner_address_id(
26 cr, pool, 'product.pulled.flow',
27 'partner_address_id', openupgrade.get_legacy_name('partner_address_id'))
28
29@openupgrade.migrate()
30def migrate(cr, version):
31 pool = pooler.get_pool(cr.dbname)
32 migrate_partners(cr, pool)
033
=== 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:59:24 +0000
@@ -0,0 +1,32 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU Affero General Public License as
8# published by the Free Software Foundation, either version 3 of the
9# License, or (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU Affero General Public License for more details.
15#
16# You should have received a copy of the GNU Affero General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
19##############################################################################
20
21from openerp.openupgrade import openupgrade
22
23column_renames = {
24 # Using magic None value to trigger call to get_legacy_name()
25 'product_pulled_flow':[
26 ('partner_address_id', None),
27 ],
28}
29
30@openupgrade.migrate()
31def migrate(cr, version):
32 openupgrade.rename_columns(cr, column_renames)

Subscribers

People subscribed via source and target branches