[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:
+1
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user