From d436061ee660de07fb08d72de44cb0deeac420ba Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 2 Feb 2017 14:20:59 +0100 Subject: [PATCH] [FIX] db: list db without a base module If a database had no base module or no latest_version, mark it as incompatible. This should not happen in standard but as we are considering local databases that may be non-odoo, we should be more fault tolerant. --- odoo/service/db.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/odoo/service/db.py b/odoo/service/db.py index 076f60a5752..5e74c6d38b3 100644 --- a/odoo/service/db.py +++ b/odoo/service/db.py @@ -357,10 +357,14 @@ def list_db_incompatible(databases): cr.execute("SELECT 1 FROM information_schema.tables WHERE table_name='ir_module_module'") if cr.fetchone(): cr.execute("SELECT latest_version FROM ir_module_module WHERE name=%s", ('base',)) - base_version = cr.fetchone()[0] - # e.g. 10.saas~15 - if '.'.join(base_version.split('.')[:2]) != server_version: + base_version = cr.fetchone() + if not base_version or not base_version[0]: incompatible_databases.append(database_name) + else: + # e.g. 10.saas~15 + local_version = '.'.join(base_version[0].split('.')[:2]) + if local_version != server_version: + incompatible_databases.append(database_name) else: incompatible_databases.append(database_name) # release connection