← Back to team overview

credativ team mailing list archive

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

 

Holger Brunn (Therp) has proposed merging lp:~therp-nl/openupgrade-addons/6.0_membership into lp:openupgrade-addons/6.0.

Requested reviews:
  OpenUpgrade Committers (openupgrade-committers)

For more details, see:
https://code.launchpad.net/~therp-nl/openupgrade-addons/6.0_membership/+merge/138885
-- 
https://code.launchpad.net/~therp-nl/openupgrade-addons/6.0_membership/+merge/138885
Your team OpenUpgrade Committers is requested to review the proposed merge of lp:~therp-nl/openupgrade-addons/6.0_membership into lp:openupgrade-addons/6.0.
=== added file 'membership/migrations/6.0.0.1/post-migration.py'
--- membership/migrations/6.0.0.1/post-migration.py	1970-01-01 00:00:00 +0000
+++ membership/migrations/6.0.0.1/post-migration.py	2012-12-09 16:46:23 +0000
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    This migration script 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 openupgrade import openupgrade
+
+@openupgrade.migrate()
+def migrate(cr, version):
+    cr.execute('''
+      update membership_membership_line set 
+        membership_id=(select product_id 
+          from account_invoice_line 
+          where id=account_invoice_line), 
+        member_price=(select price_subtotal 
+          from account_invoice_line 
+          where id=account_invoice_line),
+        date=create_date''')