[ADD] Kanban buttons support type="switch_<viewtype>"

bzr revid: fme@openerp.com-20111208122535-mwfcxumecreg588b
This commit is contained in:
Fabien Meghazi
2011-12-08 13:25:35 +01:00
parent 75fb009dae
commit 31e245129e
+3 -1
View File
@@ -429,7 +429,9 @@ openerp.web_kanban.KanbanRecord = openerp.web.Widget.extend({
var $action = $(this),
type = $action.data('type') || 'button',
method = 'do_action_' + (type === 'action' ? 'object' : type);
if (typeof self[method] === 'function') {
if (_.str.startsWith(type, 'switch_')) {
self.view.do_switch_view(type.substr(7));
} else if (typeof self[method] === 'function') {
self[method]($action);
} else {
self.do_warn("Kanban: no action for type : " + type);