Merge lp:~camptocamp/openupgrade-tools/7.0-add-database_cleanup-purge-model-attachment-error2 into lp:~therp-nl/openupgrade-tools/7.0-add-database_cleanup

Proposed by Guewen Baconnier @ Camptocamp
Status: Merged
Merged at revision: 6
Proposed branch: lp:~camptocamp/openupgrade-tools/7.0-add-database_cleanup-purge-model-attachment-error2
Merge into: lp:~therp-nl/openupgrade-tools/7.0-add-database_cleanup
Diff against target: 24 lines (+6/-7)
1 file modified
database_cleanup/model/purge_models.py (+6/-7)
To merge this branch: bzr merge lp:~camptocamp/openupgrade-tools/7.0-add-database_cleanup-purge-model-attachment-error2
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) (community) Approve
Review via email: mp+205125@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks! My bad for merging the proposal blindly...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database_cleanup/model/purge_models.py'
--- database_cleanup/model/purge_models.py 2014-02-05 16:23:57 +0000
+++ database_cleanup/model/purge_models.py 2014-02-06 11:09:29 +0000
@@ -66,14 +66,13 @@
66 row = cr.fetchone()66 row = cr.fetchone()
67 if row:67 if row:
68 self.logger.info('Purging model %s', row[1])68 self.logger.info('Purging model %s', row[1])
69 cr.execute(69 attachment_ids = attachment_pool.search(
70 "UPDATE ir_attachment SET res_model = FALSE "70 cr, uid, [('res_model', '=', line.name)], context=context)
71 "WHERE id in %s",
72 (tuple(attachment_ids), ))
73 if attachment_ids:71 if attachment_ids:
74 attachment_pool.write(72 cr.execute(
75 cr, uid, attachment_ids, {'res_model': False},73 "UPDATE ir_attachment SET res_model = FALSE "
76 context=context)74 "WHERE id in %s",
75 (tuple(attachment_ids), ))
77 constraint_ids = constraint_pool.search(76 constraint_ids = constraint_pool.search(
78 cr, uid, [('model', '=', line.name)], context=context)77 cr, uid, [('model', '=', line.name)], context=context)
79 if constraint_ids:78 if constraint_ids:

Subscribers

People subscribed via source and target branches

to all changes: