diff --git a/bin/addons/base/__openerp__.py b/bin/addons/base/__openerp__.py index 2cd33c2213e..09e5fc23ace 100644 --- a/bin/addons/base/__openerp__.py +++ b/bin/addons/base/__openerp__.py @@ -48,6 +48,7 @@ 'module/module_web_view.xml', 'module/module_data.xml', 'module/module_report.xml', + 'module/wizard/base_module_import_view.xml', 'res/res_request_view.xml', 'res/res_lang_view.xml', 'res/res_log_view.xml', @@ -62,9 +63,11 @@ 'res/partner/wizard/partner_clear_ids_view.xml', 'res/partner/wizard/partner_wizard_ean_check_view.xml', 'res/partner/partner_data.xml', + 'res/ir_property_view.xml', 'security/base_security.xml', 'maintenance/maintenance_view.xml', + 'security/ir.model.access.csv' ], diff --git a/bin/addons/base/module/module_wizard.xml b/bin/addons/base/module/module_wizard.xml index b989fc56041..b7653eb30d9 100644 --- a/bin/addons/base/module/module_wizard.xml +++ b/bin/addons/base/module/module_wizard.xml @@ -1,12 +1,6 @@ - - Import module - base.module.import - - - Update Modules List module.module.update @@ -15,7 +9,7 @@ - + diff --git a/bin/addons/base/module/wizard/__init__.py b/bin/addons/base/module/wizard/__init__.py index c0af5977b21..69215e90c8c 100644 --- a/bin/addons/base/module/wizard/__init__.py +++ b/bin/addons/base/module/wizard/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -26,8 +26,9 @@ import wizard_module_lang_install import add_new import wizard_export_lang import wizard_import_lang -import wizard_module_import import wizard_update_translations +import base_module_import + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/bin/addons/base/module/wizard/base_module_import.py b/bin/addons/base/module/wizard/base_module_import.py new file mode 100644 index 00000000000..fc28452c6dd --- /dev/null +++ b/bin/addons/base/module/wizard/base_module_import.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +import pooler +import os +import tools + +import zipfile +from StringIO import StringIO +import base64 +from tools.translate import _ +from osv import osv, fields + +class base_module_import(osv.osv_memory): + """ Import Module """ + + _name = "base.module.import" + _description = "Import Module" + + _columns = { + 'module_file': fields.binary('Module .ZIP file', required=True), + } + + def action_module_open(self, cr, uid, ids, context): + module_obj = self.pool.get('base.module.import') + data = module_obj.browse(cr, uid, ids , context=context)[0] + module_data = data.module_file + + val =base64.decodestring(module_data) + fp = StringIO() + fp.write(val) + fdata = zipfile.ZipFile(fp, 'r') + fname = fdata.namelist()[0] + module_name = os.path.split(fname)[0] + + return { + 'domain': str([('name', '=', module_name)]), + 'name': 'Module List', + 'view_type': 'form', + 'view_mode': 'tree,form', + 'res_model': 'ir.module.module', + 'type': 'ir.actions.act_window', + } + +base_module_import() + diff --git a/bin/addons/base/module/wizard/base_module_import_view.xml b/bin/addons/base/module/wizard/base_module_import_view.xml new file mode 100644 index 00000000000..818a7317c61 --- /dev/null +++ b/bin/addons/base/module/wizard/base_module_import_view.xml @@ -0,0 +1,42 @@ + + + + + + Module Import + base.module.import + form + +
+ +