when the base.sql is not found.
bzr revid: vmt@openerp.com-
20110916121315-lklf5nib8u1pztk5
##############################################################################
import openerp.modules
+import logging
def is_initialized(cr):
""" Check if a database has been initialized for the ORM.
"""
f = openerp.modules.get_module_resource('base', 'base.sql')
+ if not f:
+ m = "File not found: 'base.sql' (provided by module 'base')."
+ logging.getLogger('init').critical(m)
+ raise IOError(m)
base_sql_file = openerp.tools.misc.file_open(f)
try:
cr.execute(base_sql_file.read())