From 89eb1140918c7389a2d67e189b96a8a5697cbe6b Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 9 Dec 2011 12:40:02 +0100 Subject: [PATCH] [ADD] API for immediate installation of modules (modules kanban view), buttons everywhere, remove weird kanban image fallback bzr revid: xmo@openerp.com-20111209114002-dlz79hxft05bhnqx --- openerp/addons/base/module/module.py | 14 +++++++++++++- openerp/addons/base/module/module_view.xml | 11 ++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/openerp/addons/base/module/module.py b/openerp/addons/base/module/module.py index 5db21282c65..a2fa5084c39 100644 --- a/openerp/addons/base/module/module.py +++ b/openerp/addons/base/module/module.py @@ -321,7 +321,19 @@ class module(osv.osv): def button_install(self, cr, uid, ids, context=None): self.state_update(cr, uid, ids, 'to install', ['uninstalled'], context) return dict(ACTION_DICT, name=_('Install')) - + + def button_immediate_install(self, cr, uid, ids, context=None): + """ Installs the selected module(s) immediately and fully, + returns the next res.config action to execute + + :param ids: identifiers of the modules to install + :returns: next res.config item to execute + :rtype: dict[str, object] + """ + self.state_update(cr, uid, ids, 'to install', ['uninstalled'], context) + cr.commit() + db, pool = pooler.restart_pool(cr.dbname, update_module=True) + return pool.get('res.config').next(db.cursor(), uid, [], context=context) def button_install_cancel(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state': 'uninstalled', 'demo':False}) diff --git a/openerp/addons/base/module/module_view.xml b/openerp/addons/base/module/module_view.xml index 76aec91b98e..99468493814 100644 --- a/openerp/addons/base/module/module_view.xml +++ b/openerp/addons/base/module/module_view.xml @@ -70,8 +70,9 @@ + - +

@@ -79,13 +80,9 @@
Complex

- Install - + +
-