Merge lp:~therp-nl/openupgrade-addons/6.0_membership into lp:openupgrade-addons/6.0

Proposed by Holger Brunn (Therp) on 2012-12-09
Status: Merged
Merged at revision: 4789
Proposed branch: lp:~therp-nl/openupgrade-addons/6.0_membership
Merge into: lp:openupgrade-addons/6.0
Diff against target: 38 lines (+34/-0)
1 file modified
membership/migrations/6.0.0.1/post-migration.py (+34/-0)
To merge this branch: bzr merge lp:~therp-nl/openupgrade-addons/6.0_membership
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) 2012-12-09 Approve on 2012-12-09
Review via email: mp+138885@code.launchpad.net
To post a comment you must log in.

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'membership/migrations/6.0.0.1/post-migration.py'
2--- membership/migrations/6.0.0.1/post-migration.py 1970-01-01 00:00:00 +0000
3+++ membership/migrations/6.0.0.1/post-migration.py 2012-12-09 16:46:23 +0000
4@@ -0,0 +1,34 @@
5+# -*- coding: utf-8 -*-
6+##############################################################################
7+#
8+# OpenERP, Open Source Management Solution
9+# This migration script copyright (C) 2012 Therp BV (<http://therp.nl>)
10+#
11+# This program is free software: you can redistribute it and/or modify
12+# it under the terms of the GNU Affero General Public License as
13+# published by the Free Software Foundation, either version 3 of the
14+# License, or (at your option) any later version.
15+#
16+# This program is distributed in the hope that it will be useful,
17+# but WITHOUT ANY WARRANTY; without even the implied warranty of
18+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+# GNU Affero General Public License for more details.
20+#
21+# You should have received a copy of the GNU Affero General Public License
22+# along with this program. If not, see <http://www.gnu.org/licenses/>.
23+#
24+##############################################################################
25+
26+from openupgrade import openupgrade
27+
28+@openupgrade.migrate()
29+def migrate(cr, version):
30+ cr.execute('''
31+ update membership_membership_line set
32+ membership_id=(select product_id
33+ from account_invoice_line
34+ where id=account_invoice_line),
35+ member_price=(select price_subtotal
36+ from account_invoice_line
37+ where id=account_invoice_line),
38+ date=create_date''')

Subscribers

People subscribed via source and target branches