EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
Complete task from list use first status
Yurii3e9def4a69c0
diff --git a/client/modules/crm/src/views/task/record/list.js b/client/modules/crm/src/views/task/record/list.jsindex f7075635d5..eac0070eb2 100644--- a/client/modules/crm/src/views/task/record/list.js+++ b/client/modules/crm/src/views/task/record/list.js@@ -27,6 +27,7 @@************************************************************************/import ListRecordView from 'views/record/list';+import Ui from 'ui';export default class extends ListRecordView {@@ -45,10 +46,15 @@ export default class extends ListRecordView {return;}- Espo.Ui.notify(this.translate('saving', 'messages'));+ /** @var string[]*/+ const completedStatusList = this.getMetadata().get(`scopes.Task.completedStatusList`, []);- model.save({status: 'Completed'}, {patch: true}).then(() => {- Espo.Ui.success(this.translate('Saved'));+ const status = completedStatusList[0] ?? null;;++ Ui.notify(this.translate('saving', 'messages'));++ model.save({status: status}, {patch: true}).then(() => {+ Ui.success(this.translate('Saved'));this.collection.fetch();});