+ return this._super.apply(this, arguments).then(function () {
+ // Replace the "Save Row" button with "Cancel Edition"
+ self.edition_form.$element
+ .undelegate('button.oe-edit-row-save', 'click')
+ .delegate('button.oe-edit-row-save', 'click', function () {
+ self.cancel_pending_edition();
+ });
+
+ // Overload execute_action on the edition form to perform a simple
+ // reload_record after the action is done, rather than fully
+ // reload the parent view (or something)
+ var _execute_action = self.edition_form.do_execute_action;
+ self.edition_form.do_execute_action = function (action, dataset, record_id, _callback) {
+ return _execute_action.call(this, action, dataset, record_id, function () {
+ self.view.reload_record(
+ self.view.records.get(record_id));
+ });
+ };
+
+ self.edition_form.on('blurred', null, function () {
+ if (self.__return_blur) {
+ delete self.__return_blur;
+ return;
+ }
+ if (!self.edition_form.widget_is_stopped) {
+ self.view.ensure_saved();
+ }
+ });
+ });
+ },
+ on_row_keyup: function (e) {
+ if (e.which === this.KEY_RETURN) {
+ this.__return_blur = true;
+ }
+ this._super(e);