Merge lp:~camptocamp/openerp-product-attributes/7.0-fix-1259975-migration-lep into lp:~product-core-editors/openerp-product-attributes/7.0

Proposed by Leonardo Pistone
Status: Merged
Merged at revision: 229
Proposed branch: lp:~camptocamp/openerp-product-attributes/7.0-fix-1259975-migration-lep
Merge into: lp:~product-core-editors/openerp-product-attributes/7.0
Diff against target: 24 lines (+9/-8)
1 file modified
product_custom_attributes/migrations/7.0.0.2/post-migration.py (+9/-8)
To merge this branch: bzr merge lp:~camptocamp/openerp-product-attributes/7.0-fix-1259975-migration-lep
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp code review Approve
Alexandre Fayolle - camptocamp code review, no test Approve
Review via email: mp+198592@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

review: Approve (code review, no test)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM
Thanks

review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'product_custom_attributes/migrations/7.0.0.2/post-migration.py'
--- product_custom_attributes/migrations/7.0.0.2/post-migration.py 2013-09-30 11:21:33 +0000
+++ product_custom_attributes/migrations/7.0.0.2/post-migration.py 2013-12-11 15:53:04 +0000
@@ -25,11 +25,12 @@
2525
2626
27def migrate(cr, version):27def migrate(cr, version):
28 logger.info("Migrating product_custom_attributes from version %s", version)28 if version: # do not run on a fresh DB, see lp:1259975
29 cr.execute("UPDATE product_template pt "29 logger.info("Migrating product_custom_attributes from version %s", version)
30 "SET attribute_set_id = (SELECT pp.attribute_set_id "30 cr.execute("UPDATE product_template pt "
31 " FROM product_product pp WHERE "31 "SET attribute_set_id = (SELECT pp.attribute_set_id "
32 " pp.product_tmpl_id = pt.id "32 " FROM product_product pp WHERE "
33 " LIMIT 1)"33 " pp.product_tmpl_id = pt.id "
34 "WHERE pt.attribute_set_id IS NULL")34 " LIMIT 1)"
35 cr.execute('ALTER TABLE product_product DROP COLUMN attribute_set_id')35 "WHERE pt.attribute_set_id IS NULL")
36 cr.execute('ALTER TABLE product_product DROP COLUMN attribute_set_id')

Subscribers

People subscribed via source and target branches