summaryrefslogtreecommitdiff
path: root/odoo/tools/sql.py
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2017-04-26 11:02:51 +0200
committerDenis Ledoux <dle@odoo.com>2017-07-05 13:47:29 +0200
commitad67f7aff8a85ad432b3af8e235ae9f5ca91066b (patch)
tree397e3cbf818249db4f6e6bb5e4b1890acfe92e51 /odoo/tools/sql.py
parentcef90a559a594aa4c15c855737f0c413e44c25eb (diff)
[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.
Diffstat (limited to 'odoo/tools/sql.py')
-rw-r--r--odoo/tools/sql.py2
1 files changed, 1 insertions, 1 deletions
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