Skip to content

EspoCRM – Open Source CRM Application

Use currency no join by default. Clear cache after currency changes.

Yurii11d857216d19
diff --git a/application/Espo/Core/Utils/Database/Orm/FieldConverters/Currency.php b/application/Espo/Core/Utils/Database/Orm/FieldConverters/Currency.php
index 46fa5ec042..94976b9697 100644
--- a/application/Espo/Core/Utils/Database/Orm/FieldConverters/Currency.php
+++ b/application/Espo/Core/Utils/Database/Orm/FieldConverters/Currency.php
@@ -98,7 +98,7 @@ class Currency implements FieldConverter
}
if (!$fieldDefs->isNotStorable()) {
- [$amountDefs, $convertedDefs] = $this->config->get('currencyNoJoinMode') ?
+ [$amountDefs, $convertedDefs] = ($this->config->get('currencyNoJoinMode') !== false) ?
$this->applyNoJoinMode($fieldDefs, $amountDefs) :
$this->applyJoinMode($fieldDefs, $amountDefs, $entityType);
}
diff --git a/application/Espo/Tools/App/SettingsService.php b/application/Espo/Tools/App/SettingsService.php
index 1e0ce61083..c239a4c102 100644
--- a/application/Espo/Tools/App/SettingsService.php
+++ b/application/Espo/Tools/App/SettingsService.php
@@ -253,7 +253,12 @@ class SettingsService
$this->configWriter->setMultiple(get_object_vars($data));
$this->configWriter->save();
- if (isset($data->personNameFormat)) {
+ if (
+ isset($data->personNameFormat) ||
+ isset($data->baseCurrency) ||
+ isset($data->currencyList) ||
+ isset($data->defaultCurrency)
+ ) {
$this->dataManager->clearCache();
}