diff --git a/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json b/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json
index fb7626f384..0eb7afb0c4 100644
--- a/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json
+++ b/application/Espo/Modules/Crm/Resources/i18n/en_US/Account.json
@@ -44,12 +44,15 @@
"Computer": "Computer",
"Education": "Education",
"Electronics": "Electronics",
+ "Energy": "Energy",
"Entertainment & Leisure": "Entertainment & Leisure",
"Finance": "Finance",
"Food & Beverage": "Food & Beverage",
"Grocery": "Grocery",
+ "Healthcare": "Healthcare",
"Insurance": "Insurance",
"Legal": "Legal",
+ "Manufacturing": "Manufacturing",
"Publishing": "Publishing",
"Real Estate": "Real Estate",
"Service": "Service",
diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json
index c485c81b2b..dc4f4be891 100644
--- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json
+++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Account.json
@@ -33,12 +33,15 @@
"Computer",
"Education",
"Electronics",
+ "Energy",
"Entertainment & Leisure",
"Finance",
"Food & Beverage",
"Grocery",
+ "Healthcare",
"Insurance",
"Legal",
+ "Manufacturing",
"Publishing",
"Real Estate",
"Service",
diff --git a/frontend/client/res/templates/fields/currency/edit.tpl b/frontend/client/res/templates/fields/currency/edit.tpl
index dbcf76627a..fc88f6dc3b 100644
--- a/frontend/client/res/templates/fields/currency/edit.tpl
+++ b/frontend/client/res/templates/fields/currency/edit.tpl
@@ -2,7 +2,8 @@
diff --git a/frontend/client/src/views/fields/currency.js b/frontend/client/src/views/fields/currency.js
index 272e1b312a..cf84b2a36a 100644
--- a/frontend/client/src/views/fields/currency.js
+++ b/frontend/client/src/views/fields/currency.js
@@ -34,43 +34,24 @@ Espo.define('Views.Fields.Currency', 'Views.Fields.Float', function (Dep) {
data: function () {
return _.extend({
currencyFieldName: this.currencyFieldName,
- currencyValue: this.currencyValue,
+ currencyValue: this.model.get(this.currencyFieldName),
currencyOptions: this.currencyOptions,
+ currencyList: this.currencyList
}, Dep.prototype.data.call(this));
},
setup: function () {
Dep.prototype.setup.call(this);
this.currencyFieldName = this.name + 'Currency';
-
+ this.currencyList = this.getConfig().get('currencyList') || ['USD', 'EUR'];
var currencyValue = this.currencyValue = this.model.get(this.currencyFieldName) || this.getConfig().get('defaultCurrency');
- this.listenTo(this.model, 'change:' + this.currencyFieldName, function () {
- this.currencyValue = this.model.get(this.currencyFieldName);
- this.updateCurrency();
- }.bind(this));
-
- if (this.mode == 'edit' || this.mode == 'detail') {
- this.updateCurrency();
- }
- },
-
- updateCurrency: function () {
- this.currencyList = this.getConfig().get('currencyList') || ['USD', 'EUR'];
- var currencyOptions = '';
- this.currencyList.forEach(function (code) {
- currencyOptions += '';
- }, this);
- this.currencyOptions = currencyOptions;
},
afterRender: function () {
Dep.prototype.afterRender.call(this);
if (this.mode == 'edit') {
this.$currency = this.$el.find('[name="' + this.currencyFieldName + '"]');
- this.$currency.on('change', function () {
- this.trigger('change');
- }.bind(this));
}
},