fix task complete sent twice
This commit is contained in:
@@ -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();
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user