diff --git a/fyo/model/doc.ts b/fyo/model/doc.ts index c78d9aba..18128bfd 100644 --- a/fyo/model/doc.ts +++ b/fyo/model/doc.ts @@ -5,7 +5,6 @@ import { Verb } from 'fyo/telemetry/types'; import { DEFAULT_USER } from 'fyo/utils/consts'; import { ConflictError, MandatoryError, NotFoundError } from 'fyo/utils/errors'; import Observable from 'fyo/utils/observable'; -import { Money } from 'pesa'; import { DynamicLinkField, Field, @@ -142,6 +141,10 @@ export class Doc extends Observable { return false; } + if (this.schema.isChild) { + return false; + } + if (!this.schema.isSubmittable) { return true; } @@ -186,6 +189,14 @@ export class Doc extends Observable { return false; } + if (this.schema.isSingle) { + return false; + } + + if (this.schema.isChild) { + return false; + } + return true; } diff --git a/src/App.vue b/src/App.vue index 01361390..f3312327 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,6 +41,7 @@ import { ConfigKeys } from 'fyo/core/types'; import { RTL_LANGUAGES } from 'fyo/utils/consts'; import { ModelNameEnum } from 'models/types'; +import { systemLanguageRef } from 'src/utils/refs'; import { computed } from 'vue'; import WindowsTitleBar from './components/WindowsTitleBar.vue'; import { handleErrorWithDialog } from './errorHandling'; @@ -54,7 +55,8 @@ import { initializeInstance } from './utils/initialization'; import { checkForUpdates } from './utils/ipcCalls'; import { updateConfigFiles } from './utils/misc'; import { Search } from './utils/search'; -import { routeTo, systemLanguage } from './utils/ui'; +import { setGlobalShortcuts } from './utils/shortcuts'; +import { routeTo } from './utils/ui'; import { Shortcuts, useKeys } from './utils/vueUtils'; export default { @@ -86,7 +88,8 @@ export default { WindowsTitleBar, }, async mounted() { - this.shortcuts = new Shortcuts(this.keys); + const shortcuts = new Shortcuts(this.keys); + this.shortcuts = shortcuts; const lastSelectedFilePath = fyo.config.get( ConfigKeys.LastSelectedFilePath, null @@ -102,10 +105,12 @@ export default { await handleErrorWithDialog(err, undefined, true, true); await this.showDbSelector(); } + + setGlobalShortcuts(shortcuts); }, computed: { language() { - return systemLanguage.value; + return systemLanguageRef.value; }, languageDirection() { return RTL_LANGUAGES.includes(this.language) ? 'rtl' : 'ltr'; diff --git a/src/components/FormContainer.vue b/src/components/FormContainer.vue index dddc9cb2..2ad11f78 100644 --- a/src/components/FormContainer.vue +++ b/src/components/FormContainer.vue @@ -1,5 +1,5 @@