Merge lp:~syleam/wms/5.0-christophe-chauvet into lp:wms

Proposed by Christophe CHAUVET
Status: Merged
Merged at revision: 219
Proposed branch: lp:~syleam/wms/5.0-christophe-chauvet
Merge into: lp:wms
Diff against target: 11 lines (+2/-2)
1 file modified
wms_location/migrations/0.2.0/pre-10-update-crossdock-location.py (+2/-2)
To merge this branch: bzr merge lp:~syleam/wms/5.0-christophe-chauvet
Reviewer Review Type Date Requested Status
Christophe CHAUVET Approve
Review via email: mp+54225@code.launchpad.net

Description of the change

Fix issue when no crossdock location to migrate

To post a comment you must log in.
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

Ok

review: Approve
219. By Christophe CHAUVET

merge from lp:~syleam/wms/5.0-christophe-chauvet to fix issue with migration script

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wms_location/migrations/0.2.0/pre-10-update-crossdock-location.py'
2--- wms_location/migrations/0.2.0/pre-10-update-crossdock-location.py 2011-03-02 22:37:03 +0000
3+++ wms_location/migrations/0.2.0/pre-10-update-crossdock-location.py 2011-03-21 15:22:15 +0000
4@@ -53,8 +53,8 @@
5 ##
6 cr.execute("""SELECT id FROM stock_location WHERE usage='crossdock'""")
7 loc_ids = [x[0] for x in cr.fetchall()]
8-
9- cr.execute("""UPDATE stock_location SET categ_id=%s, usage='internal' WHERE id IN %s""", (res[0], tuple(loc_ids),))
10+ if loc_ids:
11+ cr.execute("""UPDATE stock_location SET categ_id=%s, usage='internal' WHERE id IN %s""", (res[0], tuple(loc_ids),))
12
13
14

Subscribers

People subscribed via source and target branches