diff --git a/application/Espo/Modules/Crm/Repositories/Lead.php b/application/Espo/Modules/Crm/Repositories/Lead.php index 0f030dda06..4c0065d8c6 100644 --- a/application/Espo/Modules/Crm/Repositories/Lead.php +++ b/application/Espo/Modules/Crm/Repositories/Lead.php @@ -30,7 +30,7 @@ class Lead extends \Espo\Core\ORM\Repositories\RDB { parent::afterSave($entity, $options); - if ($entity->has('targetListId') && $entity->isNew()) { + if ($entity->has('targetListId')) { $this->relate($entity, 'targetLists', $entity->get('targetListId')); } } diff --git a/application/Espo/Services/Import.php b/application/Espo/Services/Import.php index e14a830b37..d1fd33ebea 100644 --- a/application/Espo/Services/Import.php +++ b/application/Espo/Services/Import.php @@ -369,17 +369,18 @@ class Import extends \Espo\Services\Record if (array_key_exists('id', $whereClause)) { $entity->set('id', $whereClause['id']); } + $entity->set('assignedUserId', $this->getUser()->id); } else { return; } } } else { $entity = $this->getEntityManager()->getEntity($scope); + $entity->set('assignedUserId', $this->getUser()->id); } $isNew = $entity->isNew(); - $entity->set('assignedUserId', $this->getUser()->id); if (!empty($params['defaultValues'])) { $v = get_object_vars($params['defaultValues']);