Browse Source

[FIX] sale_exception: Make a defensive check before processing table and model rename (#1486)

pull/1491/head
Florent THOMAS 6 years ago
committed by Pedro M. Baeza
parent
commit
0824ef11c9
  1. 5
      base_exception/migrations/10.0.2.0.0/pre-migration.py

5
base_exception/migrations/10.0.2.0.0/pre-migration.py

@ -8,5 +8,6 @@ from openupgradelib import openupgrade
@openupgrade.migrate(use_env=True) @openupgrade.migrate(use_env=True)
def migrate(env, version): def migrate(env, version):
cr = env.cr cr = env.cr
openupgrade.rename_tables(cr, [('sale_exception', 'exception_rule')])
openupgrade.rename_models(cr, [('sale.exception', 'exception.rule')])
if openupgrade.table_exists('sale_exception'):
openupgrade.rename_tables(cr, [('sale_exception', 'exception_rule')])
openupgrade.rename_models(cr, [('sale.exception', 'exception.rule')])
Loading…
Cancel
Save