Skip to content

EspoCRM – Open Source CRM Application

Pipeline stage dependes on pipeline

Yuriic47f6058ab58
diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json
index 0ad5e2e36e..43e73b7482 100644
--- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json
+++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json
@@ -38,7 +38,8 @@
],
"default": "New",
"style": {
- "In Process": "primary",
+ "Assigned": "primary",
+ "In Process": "warning",
"Converted": "success",
"Recycled": "info",
"Dead": "info"
diff --git a/application/Espo/Tools/EntityManager/Hook/Hooks/PipelinesUpdateHook.php b/application/Espo/Tools/EntityManager/Hook/Hooks/PipelinesUpdateHook.php
index b1ed53d12f..ec4a51679e 100644
--- a/application/Espo/Tools/EntityManager/Hook/Hooks/PipelinesUpdateHook.php
+++ b/application/Espo/Tools/EntityManager/Hook/Hooks/PipelinesUpdateHook.php
@@ -132,6 +132,14 @@ class PipelinesUpdateHook implements UpdateHook
],
]);
+ $this->metadata->set('selectDefs', $entityType, [
+ 'selectAttributesDependencyMap' => [
+ Field::PIPELINE_STAGE . 'Id' => [
+ Field::PIPELINE . 'Id',
+ ]
+ ]
+ ]);
+
$this->metadata->save();
$this->dataManager->rebuild([$entityType]);
@@ -173,6 +181,10 @@ class PipelinesUpdateHook implements UpdateHook
'linkCheckerClassNameMap.' . Field::PIPELINE_STAGE,
]);
+ $this->metadata->delete('selectDefs', $entityType, [
+ 'selectAttributesDependencyMap.' . Field::PIPELINE_STAGE . 'Id',
+ ]);
+
$this->metadata->save();
$this->dataManager->rebuild([$entityType]);