diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json index af5d486331..c6be76bb79 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json @@ -13,7 +13,8 @@ "contactRole": "Title", "campaign": "Campaign", "targetLists": "Target Lists", - "targetList": "Target List" + "targetList": "Target List", + "originalLead": "Original Lead" }, "links": { "contacts": "Contacts", @@ -27,7 +28,8 @@ "targetLists": "Target Lists", "campaignLogRecords": "Campaign Log", "campaign": "Campaign", - "portalUsers": "Portal Users" + "portalUsers": "Portal Users", + "originalLead": "Original Lead" }, "options": { "type": { diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json index 4063bee0bb..be519032a6 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Contact.json @@ -15,7 +15,8 @@ "campaign": "Campaign", "targetLists": "Target Lists", "targetList": "Target List", - "portalUser": "Portal User" + "portalUser": "Portal User", + "originalLead": "Original Lead" }, "links": { "opportunities": "Opportunities", @@ -26,7 +27,8 @@ "account": "Account (Primary)", "accounts": "Accounts", "casesPrimary": "Cases (Primary)", - "portalUser": "Portal User" + "portalUser": "Portal User", + "originalLead": "Original Lead" }, "labels": { "Create Contact": "Create Contact" diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json index 427b86cdf1..abfdb40fae 100644 --- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Opportunity.json @@ -12,12 +12,14 @@ "description": "Description", "amountConverted": "Amount (converted)", "amountWeightedConverted": "Amount Weighted", - "campaign": "Campaign" + "campaign": "Campaign", + "originalLead": "Original Lead" }, "links": { "contacts": "Contacts", "documents": "Documents", - "campaign": "Campaign" + "campaign": "Campaign", + "originalLead": "Original Lead" }, "options": { "stage": { diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json index 60e9353cef..c039678264 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json @@ -159,6 +159,12 @@ "layoutMassUpdateDisabled": true, "layoutFiltersDisabled": true, "entity": "TargetList" + }, + "originalLead": { + "type": "link", + "layoutMassUpdateDisabled": true, + "layoutListDisabled": true, + "readOnly": true } }, "links": { @@ -268,6 +274,11 @@ "type": "hasMany", "entity": "User", "foreign": "accounts" + }, + "originalLead": { + "type": "hasOne", + "entity": "Lead", + "foreign": "createdAccount" } }, "collection": { diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json index 00569f00d9..27c800e25f 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Contact.json @@ -183,6 +183,12 @@ "layoutMassUpdateDisabled": true, "layoutListDisabled": true, "readOnly": true + }, + "originalLead": { + "type": "link", + "layoutMassUpdateDisabled": true, + "layoutListDisabled": true, + "readOnly": true } }, "links": { @@ -280,6 +286,11 @@ "type": "hasOne", "entity": "User", "foreign": "contact" + }, + "originalLead": { + "type": "hasOne", + "entity": "Lead", + "foreign": "createdContact" } }, "collection": { diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json index 41edea778b..20b5ebf5b8 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json @@ -208,17 +208,20 @@ "createdAccount": { "type": "belongsTo", "entity": "Account", - "noJoin": true + "noJoin": true, + "foreign": "originalLead" }, "createdContact": { "type": "belongsTo", "entity": "Contact", - "noJoin": true + "noJoin": true, + "foreign": "originalLead" }, "createdOpportunity": { "type": "belongsTo", "entity": "Opportunity", - "noJoin": true + "noJoin": true, + "foreign": "originalLead" }, "campaign": { "type": "belongsTo", diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json index 015bcc33ff..5c9ff101bf 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json @@ -70,6 +70,12 @@ "campaign": { "type": "link" }, + "originalLead": { + "type": "link", + "layoutMassUpdateDisabled": true, + "layoutListDisabled": true, + "readOnly": true + }, "createdAt": { "type": "datetime", "readOnly": true @@ -167,6 +173,11 @@ "entity": "Campaign", "foreign": "opportunities", "noJoin": true + }, + "originalLead": { + "type": "hasOne", + "entity": "Lead", + "foreign": "createdOpportunity" } }, "collection": {