From e49264711c46ce06f7894b37a3fd671dbb411a52 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Tue, 26 Jun 2012 09:47:46 +0200 Subject: [PATCH] [IMP] res.config.settings: add method 'cancel' to reload the view bzr revid: rco@openerp.com-20120626074746-1x5x47rm01klx2hp --- openerp/addons/base/res/res_config.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index e7f54c6966e..9277184a822 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -541,4 +541,12 @@ class res_config_settings(osv.osv_memory): 'tag': 'reload', } + def cancel(self, cr, uid, ids, context=None): + # ignore the current record, and send the action to reopen the view + act_window = self.pool.get('ir.actions.act_window') + action_ids = act_window.search(cr, uid, [('res_model', '=', self._name)]) + if action_ids: + return act_window.read(cr, uid, action_ids[0], [], context=context) + return {} + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: