From d00af77206ba95f70a1bcf8afa2b82115480a0f2 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Fri, 20 Jun 2025 09:32:47 +0300 Subject: [PATCH] fix default currency --- application/Espo/Core/Record/Defaults/DefaultPopulator.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/Espo/Core/Record/Defaults/DefaultPopulator.php b/application/Espo/Core/Record/Defaults/DefaultPopulator.php index 1a6b9384cc..0f2536a25b 100644 --- a/application/Espo/Core/Record/Defaults/DefaultPopulator.php +++ b/application/Espo/Core/Record/Defaults/DefaultPopulator.php @@ -148,8 +148,10 @@ class DefaultPopulator implements Populator continue; } - if ($entity->get($field) && !$entity->get($field . 'Currency')) { - $entity->set($field . 'Currency', $this->currencyConfig->getDefaultCurrency()); + $currencyAttribute = $field . 'Currency'; + + if ($entity->get($field) !== null && !$entity->get($currencyAttribute)) { + $entity->set($currencyAttribute, $this->currencyConfig->getDefaultCurrency()); } } }