[IMP] When saving a note, it should come back to the kanban view instead of going to the page view.
bzr revid: tta@openerp.com-20121207095443-xcaflcu887bsn96u
This commit is contained in:
parent
1a8e876957
commit
b75f72f318
|
@ -57,6 +57,9 @@ Notes can be found in the 'Home' menu.
|
|||
'css': [
|
||||
'static/src/css/note.css',
|
||||
],
|
||||
'js': [
|
||||
'static/src/js/note.js',
|
||||
],
|
||||
'installable': True,
|
||||
'application': True,
|
||||
'auto_install': False,
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
openerp.note = function(instance) {
|
||||
instance.web.FormView.include({
|
||||
init: function(parent, dataset, view_id, options) {
|
||||
this._super(parent, dataset, view_id, options);
|
||||
this.options.views_history = parent.views_history;
|
||||
},
|
||||
to_view_mode: function(){
|
||||
var prev_view = this.options.views_history[this.options.views_history.length - 2];
|
||||
if(this.model == 'note.note' && prev_view == 'kanban'){
|
||||
this.do_switch_view(prev_view);
|
||||
}else{
|
||||
this._super();
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue