[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:
Tejas Tank 2012-12-07 14:54:43 +05:00
parent 1a8e876957
commit b75f72f318
2 changed files with 19 additions and 0 deletions

View File

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

View File

@ -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();
}
},
});
}