[MERGE] loading: explicitely allow .js file, log a warning for unknown types.
bzr revid: vmt@openerp.com-20121114130535-0ts5rbh51wre98ag
This commit is contained in:
@@ -112,6 +112,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
|
||||
if kind in ('demo', 'demo_xml'):
|
||||
noupdate = True
|
||||
try:
|
||||
ext = ext.lower()
|
||||
if ext == '.csv':
|
||||
if kind in ('init', 'init_xml'):
|
||||
noupdate = True
|
||||
@@ -120,8 +121,12 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
|
||||
process_sql_file(cr, fp)
|
||||
elif ext == '.yml':
|
||||
tools.convert_yaml_import(cr, module_name, fp, kind, idref, mode, noupdate, report)
|
||||
else:
|
||||
elif ext == '.xml':
|
||||
tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
|
||||
elif ext == '.js':
|
||||
pass # .js files are valid but ignored here.
|
||||
else:
|
||||
_logger.warning("Can't load unknown file type %s.", filename)
|
||||
finally:
|
||||
fp.close()
|
||||
|
||||
|
||||
@@ -28,15 +28,9 @@ import sys
|
||||
import types
|
||||
import zipimport
|
||||
|
||||
import openerp
|
||||
|
||||
import openerp.osv as osv
|
||||
import openerp.tools as tools
|
||||
import openerp.tools.osutil as osutil
|
||||
from openerp.tools.safe_eval import safe_eval as eval
|
||||
from openerp.tools.translate import _
|
||||
|
||||
import openerp.netsvc as netsvc
|
||||
|
||||
import zipfile
|
||||
import openerp.release as release
|
||||
@@ -48,9 +42,6 @@ from cStringIO import StringIO
|
||||
|
||||
import logging
|
||||
|
||||
import openerp.modules.db
|
||||
import openerp.modules.graph
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
_ad = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'addons') # default addons path (base)
|
||||
@@ -335,7 +326,6 @@ def load_information_from_description_file(module):
|
||||
'description': '',
|
||||
'icon': get_module_icon(module),
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
'license': 'AGPL-3',
|
||||
'name': False,
|
||||
'post_load': None,
|
||||
|
||||
Reference in New Issue
Block a user