Merge pull request #48404 from frappe/mergify/bp/version-15-hotfix/pr-48368

feat: add subject field to project (backport #48368)
This commit is contained in:
Mihir Kandoi
2025-07-05 12:07:00 +05:30
committed by GitHub
3 changed files with 19 additions and 5 deletions

View File

@@ -202,6 +202,12 @@ frappe.ui.form.on("Project", {
});
});
},
collect_progress: function (frm) {
if (frm.doc.collect_progress && !frm.doc.subject) {
frm.set_value("subject", __("For project {0}, update your status", [frm.doc.name]));
}
},
});
function open_form(frm, doctype, child_doctype, parentfield) {

View File

@@ -62,6 +62,7 @@
"day_to_send",
"weekly_time_to_send",
"column_break_45",
"subject",
"message"
],
"fields": [
@@ -447,6 +448,13 @@
"print_hide": 1,
"reqd": 1,
"set_only_once": 1
},
{
"depends_on": "collect_progress",
"fieldname": "subject",
"fieldtype": "Data",
"label": "Subject",
"mandatory_depends_on": "collect_progress"
}
],
"icon": "fa fa-puzzle-piece",
@@ -454,7 +462,7 @@
"index_web_pages_for_search": 1,
"links": [],
"max_attachments": 4,
"modified": "2024-04-24 10:56:16.001032",
"modified": "2025-07-03 10:54:30.444139",
"modified_by": "Administrator",
"module": "Projects",
"name": "Project",
@@ -501,6 +509,7 @@
}
],
"quick_entry": 1,
"row_format": "Dynamic",
"search_fields": "project_name,customer, status, priority, is_active",
"show_name_in_global_search": 1,
"sort_field": "modified",
@@ -509,4 +518,4 @@
"timeline_field": "customer",
"title_field": "project_name",
"track_seen": 1
}
}

View File

@@ -62,6 +62,7 @@ class Project(Document):
sales_order: DF.Link | None
second_email: DF.Time | None
status: DF.Literal["Open", "Completed", "Cancelled"]
subject: DF.Data | None
to_time: DF.Time | None
total_billable_amount: DF.Currency
total_billed_amount: DF.Currency
@@ -606,8 +607,6 @@ def send_project_update_email_to_users(project):
}
).insert()
subject = "For project %s, update your status" % (project)
incoming_email_account = frappe.db.get_value(
"Email Account", dict(enable_incoming=1, default_incoming=1), "email_id"
)
@@ -615,7 +614,7 @@ def send_project_update_email_to_users(project):
frappe.sendmail(
recipients=get_users_email(doc),
message=doc.message,
subject=_(subject),
subject=doc.subject,
reference_doctype=project_update.doctype,
reference_name=project_update.name,
reply_to=incoming_email_account,