[FIX] base.import.module: this wizard is disabled and should be dropped entirely in trunk

Kept the model for backwards compatibility until then

bzr revid: odo@openerp.com-20131018145638-0evfafu4yqg2itia
This commit is contained in:
Olivier Dony 2013-10-18 16:56:38 +02:00
parent 83ff86efe7
commit b361ec0151
1 changed files with 2 additions and 27 deletions

View File

@ -47,33 +47,8 @@ class base_module_import(osv.osv_memory):
}
def importzip(self, cr, uid, ids, context):
(data,) = self.browse(cr, uid, ids , context=context)
module_data = data.module_file
zip_data = base64.decodestring(module_data)
fp = StringIO()
fp.write(zip_data)
try:
file_data = zipfile.ZipFile(fp, 'r')
except zipfile.BadZipfile:
raise osv.except_osv(_('Error!'), _('File is not a zip file!'))
init_file_name = sorted(file_data.namelist())[0]
module_name = os.path.split(init_file_name)[0]
file_path = os.path.join(ADDONS_PATH, '%s.zip' % module_name)
try:
zip_file = open(file_path, 'wb')
except IOError:
raise osv.except_osv(_('Error!'),
_('Can not create the module file: %s!') % \
(file_path,) )
zip_file.write(zip_data)
zip_file.close()
self.pool.get('ir.module.module').update_list(cr, uid,
{'module_name': module_name,})
self.write(cr, uid, ids, {'state':'done', 'module_name': module_name},
context)
return False
#TODO: drop this model and the corresponding view/action in trunk
raise NotImplementedError('This feature is not available')
def action_module_open(self, cr, uid, ids, context):
(data,) = self.browse(cr, uid, ids , context=context)