From faf41ee3c79203f17efa74dc4627eccbd05458de Mon Sep 17 00:00:00 2001 From: akshayitzme Date: Wed, 18 Dec 2024 17:47:58 +0530 Subject: [PATCH] feat: device id field --- .../ERPNextSyncSettings/ERPNextSyncSettings.ts | 1 + schemas/app/ERPNextSyncSettings.json | 9 +++++++-- src/App.vue | 7 ++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/models/baseModels/ERPNextSyncSettings/ERPNextSyncSettings.ts b/models/baseModels/ERPNextSyncSettings/ERPNextSyncSettings.ts index 63d21b25..0046d139 100644 --- a/models/baseModels/ERPNextSyncSettings/ERPNextSyncSettings.ts +++ b/models/baseModels/ERPNextSyncSettings/ERPNextSyncSettings.ts @@ -2,6 +2,7 @@ import { Doc } from 'fyo/model/doc'; import { HiddenMap } from 'fyo/model/types'; export class ERPNextSyncSettings extends Doc { + deviceID?: string; endpoint?: string; authToken?: string; integrationAppVersion?: string; diff --git a/schemas/app/ERPNextSyncSettings.json b/schemas/app/ERPNextSyncSettings.json index 3f5a55a9..d683890a 100644 --- a/schemas/app/ERPNextSyncSettings.json +++ b/schemas/app/ERPNextSyncSettings.json @@ -5,18 +5,23 @@ "isChild": false, "isSubmittable": false, "fields": [ + { + "label": "Device ID", + "fieldname": "deviceID", + "fieldtype": "Data", + "readOnly": true, + "section": "Default" + }, { "label": "API Endpoint", "fieldname": "endpoint", "fieldtype": "Data", - "required": true, "section": "Default" }, { "label": "Auth Token", "fieldname": "authToken", "fieldtype": "Secret", - "required": true, "section": "Default" }, { diff --git a/src/App.vue b/src/App.vue index 1d9e0490..03e936f0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -70,7 +70,11 @@ import { Shortcuts } from './utils/shortcuts'; import { routeTo } from './utils/ui'; import { useKeys } from './utils/vueUtils'; import { setDarkMode } from 'src/utils/theme'; -import { initERPNSync, updateERPNSyncSettings } from './utils/erpnextSync'; +import { + initERPNSync, + registerInstanceToERPNext, + updateERPNSyncSettings, +} from './utils/erpnextSync'; enum Screen { Desk = 'Desk', @@ -225,6 +229,7 @@ export default defineComponent({ await initializeInstance(filePath, false, countryCode, fyo); await updatePrintTemplates(fyo); + await registerInstanceToERPNext(fyo); await updateERPNSyncSettings(fyo); initERPNSync(fyo); await this.setDesk(filePath);