From cc1a3c26f587ca162063f8b63135ca7bc2f58bb5 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Wed, 14 Dec 2022 13:00:44 +0530 Subject: [PATCH] fix: disappearing dropdown items w/o groups - setting of Account fields after insert - datetime editing on click --- models/baseModels/Account/Account.ts | 10 +++++++++- src/components/Controls/Datetime.vue | 6 +++++- src/components/Dropdown.vue | 14 ++++++++++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/models/baseModels/Account/Account.ts b/models/baseModels/Account/Account.ts index c9eee781..184a6662 100644 --- a/models/baseModels/Account/Account.ts +++ b/models/baseModels/Account/Account.ts @@ -5,7 +5,8 @@ import { FiltersMap, ListViewSettings, RequiredMap, - TreeViewSettings + TreeViewSettings, + ReadOnlyMap, } from 'fyo/model/types'; import { QueryFilter } from 'utils/db/types'; import { AccountRootType, AccountRootTypeEnum, AccountType } from './types'; @@ -88,4 +89,11 @@ export class Account extends Doc { return filter; }, }; + + readOnly: ReadOnlyMap = { + rootType: () => this.inserted, + parentAccount: () => this.inserted, + accountType: () => !!this.accountType && this.inserted, + isGroup: () => this.inserted, + }; } diff --git a/src/components/Controls/Datetime.vue b/src/components/Controls/Datetime.vue index a3600b25..233d51e4 100644 --- a/src/components/Controls/Datetime.vue +++ b/src/components/Controls/Datetime.vue @@ -5,7 +5,11 @@