From ad67f7aff8a85ad432b3af8e235ae9f5ca91066b Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 26 Apr 2017 11:02:51 +0200 Subject: [FIX] sql: Do no consider a table exists if this is a schema table/view Before this revision, this is not possible to create a model with a `_table` set to `domains`, for instance. --- odoo/tools/sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'odoo/tools/sql.py') diff --git a/odoo/tools/sql.py b/odoo/tools/sql.py index 563ed08c679..2772d99e3e7 100644 --- a/odoo/tools/sql.py +++ b/odoo/tools/sql.py @@ -23,7 +23,7 @@ _CONFDELTYPES = { def table_exists(cr, tablename): """ Return whether the given table exists. """ - query = "SELECT 1 FROM information_schema.tables WHERE table_name=%s" + query = "SELECT 1 FROM information_schema.tables WHERE table_name=%s AND table_schema != 'information_schema'" cr.execute(query, (tablename,)) return cr.rowcount -- cgit v1.2.3