[FIX] __init__.py corrected for processing of .sql files
lp bug: https://launchpad.net/bugs/610938 fixed bzr revid: jvo@tinyerp.com-20100728183447-vx9nmxlodo62jvfp
This commit is contained in:
parent
dfcd25ff4d
commit
af6d826fac
|
@ -590,7 +590,7 @@ log = logging.getLogger('init')
|
|||
|
||||
def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs):
|
||||
|
||||
def process_sql_file(cr, file):
|
||||
def process_sql_file(cr, fp):
|
||||
queries = fp.read().split(';')
|
||||
for query in queries:
|
||||
new_query = ' '.join(query.split())
|
||||
|
@ -655,7 +655,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs):
|
|||
file = tools.file_open(pathname)
|
||||
# TODO manage .csv file with noupdate == (kind == 'init')
|
||||
if ext == '.sql':
|
||||
process_sql_file(cr, fp)
|
||||
process_sql_file(cr, file)
|
||||
elif ext == '.csv':
|
||||
noupdate = (kind == 'init')
|
||||
tools.convert_csv_import(cr, module_name, pathname, file.read(), id_map, mode, noupdate)
|
||||
|
|
Loading…
Reference in New Issue