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:
parent
497d2bbd34
commit
fba3fb76c6
@ -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;
|
||||
}
|
||||
|
||||
|
@ -69,6 +69,10 @@ export default defineComponent({
|
||||
})
|
||||
)[0];
|
||||
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.values = fields
|
||||
.map((f) => {
|
||||
const value = data[f.fieldname];
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user