2
0
mirror of https://github.com/frappe/books.git synced 2024-11-13 00:46:28 +00:00

feat: set instance id

This commit is contained in:
18alantom 2022-03-09 15:43:55 +05:30
parent 159d943593
commit 1a9377e708
2 changed files with 5 additions and 1 deletions

View File

@ -6,7 +6,8 @@ import regionalModelUpdates from '../models/regionalModelUpdates';
import postStart, { setCurrencySymbols } from '../server/postStart';
import { DB_CONN_FAILURE } from './messages';
import runMigrate from './migrate';
import { callInitializeMoneyMaker, getSavePath, setLanguageMap } from './utils';
import { getId } from './telemetry/helpers';
import { callInitializeMoneyMaker, getSavePath } from './utils';
export async function createNewDatabase() {
const { canceled, filePath } = await getSavePath('books', 'db');
@ -81,6 +82,7 @@ export async function connectToLocalDatabase(filePath) {
files = [
{
companyName,
id: getId(),
filePath,
},
...files.filter((file) => file.filePath !== filePath),

View File

@ -5,6 +5,7 @@ import countryList from '~/fixtures/countryInfo.json';
import importCharts from '../../../accounting/importCOA';
import generateTaxes from '../../../models/doctype/Tax/RegionalEntries';
import regionalModelUpdates from '../../../models/regionalModelUpdates';
import { getId } from '../../telemetry/helpers';
import { callInitializeMoneyMaker } from '../../utils';
export default async function setupCompany(setupWizardValues) {
@ -116,6 +117,7 @@ function updateInitializationConfig(language) {
files.forEach((file) => {
if (file.filePath === filePath) {
file.companyName = frappe.AccountingSettings.companyName;
file.id = getId();
}
});
config.set('files', files);