2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 23:30:56 +00:00

fix: set currency after setup

This commit is contained in:
18alantom 2022-07-28 13:03:25 +05:30
parent c0c3046c20
commit fe35a043f8
2 changed files with 6 additions and 2 deletions

View File

@ -89,7 +89,7 @@ async function setInstanceId(fyo: Fyo) {
)) as string;
}
async function setCurrencySymbols(fyo: Fyo) {
export async function setCurrencySymbols(fyo: Fyo) {
const currencies = (await fyo.db.getAll(ModelNameEnum.Currency, {
fields: ['name', 'symbol'],
})) as { name: string; symbol: string }[];

View File

@ -10,7 +10,7 @@ import {
import { AccountRootTypeEnum } from 'models/baseModels/Account/types';
import { AccountingSettings } from 'models/baseModels/AccountingSettings/AccountingSettings';
import { ModelNameEnum } from 'models/types';
import { initializeInstance } from 'src/initFyo';
import { initializeInstance, setCurrencySymbols } from 'src/initFyo';
import { createRegionalRecords } from 'src/regional';
import { getRandomString } from 'utils';
import { defaultUOMs } from 'utils/defaults';
@ -40,6 +40,10 @@ export default async function setupInstance(
await createDefaultNumberSeries(fyo);
await completeSetup(companyName, fyo);
if (!Object.keys(fyo.currencySymbols).length) {
await setCurrencySymbols(fyo);
}
fyo.store.skipTelemetryLogging = false;
}