[IMP] res.config.settings: add method 'cancel' to reload the view

bzr revid: rco@openerp.com-20120626074746-1x5x47rm01klx2hp
This commit is contained in:
Raphael Collet 2012-06-26 09:47:46 +02:00
parent ab231e2165
commit e49264711c
1 changed files with 8 additions and 0 deletions

View File

@ -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: