Instanciate TableHandler after the rename

The instanciation of a TableHandler create the table
and so the rename is never done.

issue4578
review6101002
This commit is contained in:
Cédric Krier committed 2015-02-19 13:52:00 +01:00
1 parent 3e703ef35f
commit bbae0fcb65
1 file changed
+3 -1
+3 -1
View File
@@ -331,7 +331,6 @@ class AnalyticAccountEntry(ModelView, ModelSQL):
Account = pool.get('analytic_account.account')
TableHandler = backend.get('TableHandler')
cursor = Transaction().cursor
table = TableHandler(cursor, cls, module_name)
# Migration from 3.4: use origin as the key for One2Many
migration_3_4 = False
@@ -340,6 +339,9 @@ class AnalyticAccountEntry(ModelView, ModelSQL):
TableHandler.table_rename(cursor, old_table, cls._table)
migration_3_4 = True
# Don't create table before renaming
table = TableHandler(cursor, cls, module_name)
super(AnalyticAccountEntry, cls).__register__(module_name)
# Migration from 3.4: set root value and remove required