[MERGE] remote module import

bzr revid: fme@openerp.com-20140327140516-t7yrma5z2ipm4gnd
This commit is contained in:
Fabien Meghazi
2014-03-27 15:05:16 +01:00
3 changed files with 13 additions and 10 deletions
+1 -1
View File
@@ -1094,7 +1094,7 @@ class Root(object):
return self.dispatch(environ, start_response)
def load_addons(self):
""" Load all addons from addons patch containg static files and
""" Load all addons from addons path containing static files and
controllers and configure them. """
# TODO should we move this to ir.http so that only configured modules are served ?
statics = {}
+5 -3
View File
@@ -169,13 +169,15 @@ def get_module_icon(module):
return ('/' + module + '/') + '/'.join(iconpath)
return '/base/' + '/'.join(iconpath)
def load_information_from_description_file(module):
def load_information_from_description_file(module, mod_path=None):
"""
:param module: The name of the module (sale, purchase, ...)
:param mod_path: Physical path of module, if not providedThe name of the module (sale, purchase, ...)
"""
terp_file = get_module_resource(module, '__openerp__.py')
mod_path = get_module_path(module)
if not mod_path:
mod_path = get_module_path(module)
terp_file = opj(mod_path, '__openerp__.py')
if terp_file:
info = {}
if os.path.isfile(terp_file):
+7 -6
View File
@@ -857,12 +857,12 @@ form: module.record_id""" % (xml_id,)
def _tag_template(self, cr, el, data_node=None):
# This helper transforms a <template> element into a <record> and forwards it
tpl_id = el.get('id', el.get('t-name', '')).encode('ascii')
module = self.module
if '.' in tpl_id:
module, tpl_id = tpl_id.split('.', 1)
full_tpl_id = tpl_id
if '.' not in full_tpl_id:
full_tpl_id = '%s.%s' % (self.module, tpl_id)
# set the full template name for qweb <module>.<id>
if not (el.get('inherit_id') or el.get('inherit_option_id')):
el.set('t-name', '%s.%s' % (module, tpl_id))
el.set('t-name', full_tpl_id)
el.tag = 't'
else:
el.tag = 'data'
@@ -952,8 +952,9 @@ form: module.record_id""" % (xml_id,)
'url': self._tag_url
}
def convert_file(cr, module, filename, idref, mode='update', noupdate=False, kind=None, report=None):
pathname = os.path.join(module, filename)
def convert_file(cr, module, filename, idref, mode='update', noupdate=False, kind=None, report=None, pathname=None):
if pathname is None:
pathname = os.path.join(module, filename)
fp = misc.file_open(pathname)
ext = os.path.splitext(filename)[1].lower()
try: