fix task complete sent twice

This commit is contained in:
yuri
2017-12-18 11:53:37 +02:00
parent a6dc770afc
commit 4d9bd89544
2 changed files with 16 additions and 15 deletions
+13 -13
View File
@@ -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();
}
});
});
@@ -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();
},
}
});