EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
clone model on list to detail
Yuri Kuznetsovd1b3afdd014d
diff --git a/client/src/views/record/list.js b/client/src/views/record/list.jsindex cd6637b615..9ccadb6358 100644--- a/client/src/views/record/list.js+++ b/client/src/views/record/list.js@@ -2152,11 +2152,17 @@ class ListRecordView extends View {const model = this.collection.get(id);const scope = this.getModelScope(id);+ const clonedModel = model.clone();+const options = {id: id,- model: model,+ model: clonedModel,};+ this.listenTo(clonedModel, 'sync', () => {+ model.setMultiple(clonedModel.getClonedAttributes(), {sync: true});+ });+if (this.options.keepCurrentRootUrl) {options.rootUrl = this.getRouter().getCurrentUrl();}