diff --git a/client/modules/crm/src/views/task/list.js b/client/modules/crm/src/views/task/list.js index 7bc72b0420..ac79066277 100644 --- a/client/modules/crm/src/views/task/list.js +++ b/client/modules/crm/src/views/task/list.js @@ -24,34 +24,34 @@ * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. - ************************************************************************/ - -Espo.define('Crm:Views.Task.List', 'Views.List', function (Dep) { + ************************************************************************/ + +Espo.define('crm:views/task/list', 'views/list', function (Dep) { return Dep.extend({ - + actionSetCompleted: function (data) { + if (data.isProcessed) return; + var id = data.id; if (!id) { return; - } + } var model = this.collection.get(id); if (!model) { return; } - + model.set('status', 'Completed'); - + this.listenToOnce(model, 'sync', function () { this.notify(false); this.collection.fetch(); }, this); - + this.notify('Saving...'); - model.save(); - - }, - + model.save(); + } }); - + }); diff --git a/client/modules/crm/src/views/task/record/list.js b/client/modules/crm/src/views/task/record/list.js index 591013a112..a19f900058 100644 --- a/client/modules/crm/src/views/task/record/list.js +++ b/client/modules/crm/src/views/task/record/list.js @@ -33,6 +33,8 @@ Espo.define('crm:views/task/record/list', 'views/record/list', function (Dep) { rowActionsView: 'crm:views/task/record/row-actions/default', actionSetCompleted: function (data) { + data.isProcessed = true; + var id = data.id; if (!id) { return; @@ -51,8 +53,7 @@ Espo.define('crm:views/task/record/list', 'views/record/list', function (Dep) { this.notify('Saving...'); model.save(); - - }, + } });