From 0824ef11c96df5e59a6c6e2e77bce2e048fc6e79 Mon Sep 17 00:00:00 2001 From: Florent THOMAS Date: Tue, 29 Jan 2019 23:09:39 +0100 Subject: [PATCH] [FIX] sale_exception: Make a defensive check before processing table and model rename (#1486) --- base_exception/migrations/10.0.2.0.0/pre-migration.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base_exception/migrations/10.0.2.0.0/pre-migration.py b/base_exception/migrations/10.0.2.0.0/pre-migration.py index 35600697f..18b10bc00 100644 --- a/base_exception/migrations/10.0.2.0.0/pre-migration.py +++ b/base_exception/migrations/10.0.2.0.0/pre-migration.py @@ -8,5 +8,6 @@ from openupgradelib import openupgrade @openupgrade.migrate(use_env=True) def migrate(env, version): 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')])