Tejas Tank (OpenERP) has proposed merging
lp:~openerp-dev/openerp-web/trunk-notify-record-modification-tta into
lp:openerp-web.
Requested reviews:
OpenERP R&D Web Team (openerp-dev-web)
For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-notify-record-modification-tta/+merge/100080
Hello,
Modified record notification come before move to other menus.
Thanks,
Tejas - TTA
--
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-notify-record-modification-tta/+merge/100080
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openerp-web/trunk-notify-record-modification-tta.
=== modified file 'addons/web/static/src/js/chrome.js'
--- addons/web/static/src/js/chrome.js 2012-03-29 11:43:27 +0000
+++ addons/web/static/src/js/chrome.js 2012-03-30 08:04:20 +0000
@@ -902,6 +902,12 @@
on_menu_logout: function() {
},
on_menu_settings: function() {
+ if( $(".oe_form_dirty").length>0 )
+ if(!confirm(_t("Warning, the record has been modified, your changes will be discarded.")))
+ return;
+ else
+ $(".oe_form_dirty").removeClass();
+
var self = this;
var action_manager = new openerp.web.ActionManager(this);
var dataset = new openerp.web.DataSet (this,'res.users',this.context);
@@ -1073,6 +1079,7 @@
n.warn.apply(n, arguments);
},
on_logout: function() {
+ if( $(".oe_form_dirty").length>0 && !confirm(_t("Warning, the record has been modified, your changes will be discarded.")))return;
var self = this;
this.session.session_logout().then(function () {
$(window).unbind('hashchange', self.on_hashchange);
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js 2012-03-27 15:13:57 +0000
+++ addons/web/static/src/js/view_form.js 2012-03-30 08:04:20 +0000
@@ -171,8 +171,9 @@
return result;
});
},
- do_hide: function () {
+ do_hide: function () {
this._super();
+ this.$element.removeClass('oe_form_dirty');
if (this.sidebar) {
this.sidebar.$element.hide();
}
@@ -454,9 +455,7 @@
});
},
on_button_cancel: function() {
- if (this.can_be_discarded()) {
return this.do_prev_view({'default': 'page'});
- }
},
on_button_new: function() {
var self = this;
@@ -489,6 +488,7 @@
* @param {Boolean} [prepend_on_create=false] if ``do_save`` creates a new record, should that record be inserted at the start of the dataset (by default, records are added at the end)
*/
do_save: function(success, prepend_on_create) {
+ this.$element.removeClass('oe_form_dirty');
var self = this;
return this.mutating_mutex.exec(function() { return self.is_initialized.pipe(function() {
try {
=== modified file 'addons/web/static/src/js/views.js'
--- addons/web/static/src/js/views.js 2012-03-27 15:13:57 +0000
+++ addons/web/static/src/js/views.js 2012-03-30 08:04:20 +0000
@@ -100,6 +100,11 @@
});
},
do_action: function(action, on_close) {
+ if( $(".oe_form_dirty").length>0 )
+ if(!confirm(_t("Warning, the record has been modified, your changes will be discarded.")))
+ return;
+ else
+ $(".oe_form_dirty").removeClass();
if (_.isNumber(action)) {
var self = this;
return self.rpc("/web/action/load", { action_id: action }, function(result) {
@@ -656,6 +661,7 @@
this.do_action(action);
},
on_mode_switch: function (view_type, no_store) {
+ if( $(".oe_form_dirty").length>0 && !confirm(_t("Warning, the record has been modified, your changes will be discarded.")))return;
var self = this;
return $.when(this._super(view_type, no_store)).then(function () {
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp