[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.
This commit is contained in:
Denis Ledoux
2017-07-05 13:47:29 +02:00
parent cef90a559a
commit ad67f7aff8
+1 -1
View File
@@ -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