diff --git a/addons/hr/models/hr_employee.py b/addons/hr/models/hr_employee.py index 078b95f8096..c8d566aa3a8 100644 --- a/addons/hr/models/hr_employee.py +++ b/addons/hr/models/hr_employee.py @@ -291,6 +291,7 @@ class HrEmployeePrivate(models.Model): 'view_mode': 'form', 'target': 'new', 'context': {'active_id': self.id}, + 'views': [[False, 'form']] } return res diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 311b0ee6947..ca0c7829a2c 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1187,10 +1187,18 @@ var BasicModel = AbstractModel.extend({ method: 'toggle_active', args: [resIDs], }) - .then(function () { + .then(function (action) { // optionally clear the DataManager's cache self._invalidateCache(parent); - return self.reload(parentID); + if (!_.isEmpty(action)) { + return self.do_action(action, { + on_close: function () { + return self.reload(parentID); + } + }); + } else { + return self.reload(parentID); + } }); }, /** @@ -1211,10 +1219,18 @@ var BasicModel = AbstractModel.extend({ method: 'action_archive', args: [resIDs], }) - .then(function () { + .then(function (action) { // optionally clear the DataManager's cache self._invalidateCache(parent); - return self.reload(parentID); + if (!_.isEmpty(action)) { + return self.do_action(action, { + on_close: function () { + return self.reload(parentID); + } + }); + } else { + return self.reload(parentID); + } }); }, /** @@ -1235,10 +1251,18 @@ var BasicModel = AbstractModel.extend({ method: 'action_unarchive', args: [resIDs], }) - .then(function () { + .then(function (action) { // optionally clear the DataManager's cache self._invalidateCache(parent); - return self.reload(parentID); + if (!_.isEmpty(action)) { + return self.do_action(action, { + on_close: function () { + return self.reload(parentID); + } + }); + } else { + return self.reload(parentID); + } }); }, /**