Merge lp:~savoirfairelinux/openupgrade-server/rename_ir_model_data into lp:openupgrade-server

Status: Merged
Merged at revision: 4652
Proposed branch: lp:~savoirfairelinux/openupgrade-server/rename_ir_model_data
Merge into: lp:openupgrade-server
Diff against target: 12 lines (+2/-0)
1 file modified
openerp/openupgrade/openupgrade.py (+2/-0)
To merge this branch: bzr merge lp:~savoirfairelinux/openupgrade-server/rename_ir_model_data
Reviewer Review Type Date Requested Status
Maxime Chambreuil (http://www.savoirfairelinux.com) (community) Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+231599@code.launchpad.net

Description of the change

When renaming models, we also want to rename them in ir_model_data.

This prevents errors in rename_xmlids such as:

External ID conflict, document_page_procedure already refers to a `wiki.wiki` record, you can't define a `document.page` record with this ID.

To post a comment you must log in.
4652. By Sandy Carter (http://www.savoirfairelinux.com)

Also rename models in ir_model_data

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Very good addition!

Thanks.

review: Approve (code review)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Is this needed to be ported to 8.0?

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

I'm on it

Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve
Revision history for this message
Sylvain LE GAL (GRAP) (sylvain-legal) wrote :

Thanks.

review: Approve (code review, no test.)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/openupgrade/openupgrade.py'
2--- openerp/openupgrade/openupgrade.py 2014-02-28 10:37:41 +0000
3+++ openerp/openupgrade/openupgrade.py 2014-08-20 18:01:02 +0000
4@@ -152,6 +152,8 @@
5 'WHERE model = %s', (new, old,))
6 cr.execute('UPDATE ir_model_fields SET relation = %s '
7 'WHERE relation = %s', (new, old,))
8+ cr.execute('UPDATE ir_model_data SET model = %s '
9+ 'WHERE model = %s', (new, old,))
10 # TODO: signal where the model occurs in references to ir_model
11
12 def rename_xmlids(cr, xmlids_spec):

Subscribers

People subscribed via source and target branches