From c6ca4f4e4c6d51ff590c3208943a7bb6d8ea1906 Mon Sep 17 00:00:00 2001 From: 18alantom <2.alan.tom@gmail.com> Date: Thu, 2 Mar 2023 15:50:03 +0530 Subject: [PATCH] fix: Reports Date filter field issue - update Report Issue template --- reports/AccountReport.ts | 1 - reports/Report.ts | 5 ++++- src/errorHandling.ts | 18 +++++++++++------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/reports/AccountReport.ts b/reports/AccountReport.ts index 1e293c39..530a750f 100644 --- a/reports/AccountReport.ts +++ b/reports/AccountReport.ts @@ -28,7 +28,6 @@ import { import { Field } from 'schemas/types'; import { getMapFromList } from 'utils'; import { QueryFilter } from 'utils/db/types'; -import { logUnexpected } from 'utils/misc'; export const ACC_NAME_WIDTH = 2; export const ACC_BAL_WIDTH = 1.25; diff --git a/reports/Report.ts b/reports/Report.ts index d56361b1..744ac770 100644 --- a/reports/Report.ts +++ b/reports/Report.ts @@ -1,4 +1,6 @@ import { Fyo } from 'fyo'; +import { Converter } from 'fyo/core/converter'; +import { DocValue } from 'fyo/core/types'; import { Action } from 'fyo/model/types'; import Observable from 'fyo/utils/observable'; import { Field, RawValue } from 'schemas/types'; @@ -59,12 +61,13 @@ export abstract class Report extends Observable { return filterMap; } - async set(key: string, value: RawValue, callPostSet: boolean = true) { + async set(key: string, value: DocValue, callPostSet: boolean = true) { const field = this.filters.find((f) => f.fieldname === key); if (field === undefined) { return; } + value = Converter.toRawValue(value, field, this.fyo); const prevValue = this[key]; if (prevValue === value) { return; diff --git a/src/errorHandling.ts b/src/errorHandling.ts index d9dc8965..2d67e83e 100644 --- a/src/errorHandling.ts +++ b/src/errorHandling.ts @@ -175,15 +175,19 @@ export function getErrorHandledSync(func: Function) { function getIssueUrlQuery(errorLogObj?: ErrorLog): string { const baseUrl = 'https://github.com/frappe/books/issues/new?labels=bug'; - const body = ['

Description

', 'Add some description...', '']; + const body = [ + '

Description

', + 'Add some description...', + '', + '

Steps to Reproduce

', + 'Add steps to reproduce the error...', + '', + '

Info

', + '', + ]; if (errorLogObj) { - body.push( - '

Error Info

', - '', - `**Error**: _${errorLogObj.name}: ${errorLogObj.message}_`, - '' - ); + body.push(`**Error**: _${errorLogObj.name}: ${errorLogObj.message}_`, ''); } if (errorLogObj?.stack) {