Merge lp:~therp-nl/openupgrade-server/6.1-fix_client_action_table into lp:openupgrade-server/6.1

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 4006
Proposed branch: lp:~therp-nl/openupgrade-server/6.1-fix_client_action_table
Merge into: lp:openupgrade-server/6.1
Diff against target: 30 lines (+13/-0)
1 file modified
openerp/addons/base/migrations/6.1.1.3/pre-migration.py (+13/-0)
To merge this branch: bzr merge lp:~therp-nl/openupgrade-server/6.1-fix_client_action_table
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Review via email: mp+203112@code.launchpad.net

Description of the change

The action models do something funky: they inherit at table level. A new kind of action was introduced in 6.1: the client action.

The ORM does not take care of this table inheritance, so as the OpenERP 6.1 base.sql is skipped at migration time, we need to load the relevant stanzas manually. I only noticed it when migrating a 6.0 database to 7.0, as 7.0 has some eyecatching client actions which did not work (apps interface and messaging inbox).

Previously migrated databases can be fixed easily by executing the following SQL command:

    ALTER TABLE ir_act_client INHERIT ir_actions;

To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openerp/addons/base/migrations/6.1.1.3/pre-migration.py'
--- openerp/addons/base/migrations/6.1.1.3/pre-migration.py 2012-11-23 11:56:17 +0000
+++ openerp/addons/base/migrations/6.1.1.3/pre-migration.py 2014-01-24 17:27:29 +0000
@@ -29,6 +29,18 @@
29 ('mail_gateway', 'mail'),29 ('mail_gateway', 'mail'),
30 ]30 ]
3131
32def update_base_sql(cr):
33 """
34 ORM does not take care of inheritance at table level
35 """
36 cr.execute(
37 """
38 CREATE TABLE ir_act_client (
39 primary key(id)
40 )
41 INHERITS (ir_actions);
42 """)
43
32def fix_module_ids(cr):44def fix_module_ids(cr):
33 cr.execute(45 cr.execute(
34 # courtesy of Guewen Baconnier (Camptocamp)46 # courtesy of Guewen Baconnier (Camptocamp)
@@ -102,6 +114,7 @@
102114
103@openupgrade.migrate()115@openupgrade.migrate()
104def migrate(cr, version):116def migrate(cr, version):
117 update_base_sql(cr)
105 migrate_timestamps(cr)118 migrate_timestamps(cr)
106 add_serialization_field(cr)119 add_serialization_field(cr)
107 set_main_company(cr)120 set_main_company(cr)

Subscribers

People subscribed via source and target branches

to status/vote changes: