Reputation: 1303
I have some questions :
2.I want to show a warning message while nevigating from the page after clicking create and leaving page without save by clicking on some menu item ,backspace or back button of browser?
Upvotes: 0
Views: 562
Reputation: 11
strong textHi Yes sure you can raise Alert Message when saving record through JS script it is possible you have to write single line code in path addons/web/static/src/js/viewform.js
on_button_save: function() {
var self = this;
return this.save().done(function(result){
**if (!confirm(_t("The record has been saved"))) {
return false;
}**
self.trigger("save", result);
self.reload().then(function() {
self.to_view_mode();
var parent = self.ViewManager.ActionManager.getParent();
if(parent){
parent.menu.do_reload_needaction();
}
});
});
},
Upvotes: 0
Reputation: 980
IMHO It is better to use a workflow to define the flow of process like we have a two state new and done default state is new when user create and enter all required field and click on save trigger a workflow and change state from new to done. That tell user that he complete the flow like wise you can put a state as you required. for more detail on workflow please read from http://doc.openerp.com/v6.0/developer/3_9_Workflow_Business_Process/index.html
2.I think this feature is already implemented in new upcoming version 7.0.
Upvotes: 1