2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 19:09:01 +00:00

fix: prevent cannot read prop rootType

This commit is contained in:
18alantom 2023-05-30 11:54:33 +05:30 committed by Alan
parent 497d2bbd34
commit fba3fb76c6
3 changed files with 15 additions and 7 deletions

View File

@ -19,11 +19,15 @@ export class Account extends Doc {
parentAccount?: string;
get isDebit() {
const debitAccounts = [
AccountRootTypeEnum.Asset,
AccountRootTypeEnum.Expense,
] as AccountRootType[];
return debitAccounts.includes(this.rootType!);
if (this.rootType === AccountRootTypeEnum.Asset) {
return true;
}
if (this.rootType === AccountRootTypeEnum.Expense) {
return true;
}
return false;
}
get isCredit() {
@ -100,7 +104,7 @@ export class Account extends Doc {
isGroup: true,
};
if (doc.rootType) {
if (doc?.rootType) {
filter.rootType = doc.rootType as string;
}

View File

@ -69,6 +69,10 @@ export default defineComponent({
})
)[0];
if (!data) {
return;
}
this.values = fields
.map((f) => {
const value = data[f.fieldname];

View File

@ -36,7 +36,7 @@ export async function sendError(errorLogObj: ErrorLog) {
device_id: fyo.store.deviceId,
open_count: fyo.store.openCount,
country_code: fyo.singles.SystemSettings?.countryCode,
more: stringifyCircular(errorLogObj.more!),
more: stringifyCircular(errorLogObj.more),
};
if (fyo.store.isDevelopment) {