diff options
| author | Raphael Collet <rco@openerp.com> | 2017-02-03 09:42:35 +0100 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2017-02-22 15:24:07 +0100 |
| commit | d024c7602146ba293c0082303fd476c8613daedc (patch) | |
| tree | 1c9687cc5a5f6449be626ac67b6846096f174457 /odoo/modules/db.py | |
| parent | 8225f3649729eb930a2511d2d4bf7127e2f1eca9 (diff) | |
[REF] tools: add functions for SQL schema manipulation
This helps factoring out a certain number of similar queries, and removing a
few methods from `BaseModel`.
Diffstat (limited to 'odoo/modules/db.py')
| -rw-r--r-- | odoo/modules/db.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/odoo/modules/db.py b/odoo/modules/db.py index f2592f947e2..7106ff82b69 100644 --- a/odoo/modules/db.py +++ b/odoo/modules/db.py @@ -12,8 +12,7 @@ def is_initialized(cr): The database can be initialized with the 'initialize' function below. """ - cr.execute("SELECT relname FROM pg_class WHERE relkind='r' AND relname='ir_module_module'") - return len(cr.fetchall()) > 0 + return odoo.tools.table_exists(cr, 'ir_module_module') def initialize(cr): """ Initialize a database with for the ORM. |
