Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion desk/src/pages/ticket/TicketNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ const template = createResource({

function setupTemplateFields(fields) {
fields.forEach((field: Field) => {
templateFields[field.fieldname] = "";
templateFields[field.fieldname] = field.default || "";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Check defaults invert false values

When a Check field has Frappe's string default "0", this assignment preserves the nonempty string and UniInput treats it as truthy, causing an unchecked field to display “Yes” and submit the wrong value.

Knowledge Base Used: Helpdesk core doctypes: agents, teams, customers, knowledge base, and support config

Fix in Claude Code Fix in Codex

});
}

Expand Down
1 change: 1 addition & 0 deletions desk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export interface Field {
disabled?: boolean;
placeholder?: string | null;
readonly?: boolean;
default?: string | null;
}

export type FieldValue = string | number | boolean | null | undefined | Dayjs;
Expand Down
3 changes: 2 additions & 1 deletion helpdesk/helpdesk/doctype/hd_ticket_template/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def get_fields(template: str, fetch: Literal["Custom Field", "DocField"]):
QBFetch.link_filters,
QBFetch.depends_on,
QBFetch.mandatory_depends_on,
QBFetch.default,
fields.fieldname,
fields.hide_from_customer,
fields.required,
Expand All @@ -113,7 +114,7 @@ def get_fields(template: str, fetch: Literal["Custom Field", "DocField"]):
.orderby(fields.idx)
.run(as_dict=True)
)
docfields = ["link_filters", "depends_on", "mandatory_depends_on"]
docfields = ["link_filters", "depends_on", "mandatory_depends_on", "default"]

for df in docfields:
for field in result:
Expand Down
Loading