From e7aa147b904547c436b65d450913f85f4f113203 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 25 Sep 2015 15:41:38 +0300 Subject: [PATCH] fix import --- application/Espo/Modules/Crm/Repositories/Lead.php | 2 +- application/Espo/Services/Import.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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']);