Merge pull request #57609 from mihir-kandoi/fix/title-field-parity

fix(projects): read the Timesheet label from the employee field
This commit is contained in:
Mihir Kandoi
2026-07-30 08:36:31 +05:30
committed by GitHub
3 changed files with 14 additions and 5 deletions

View File

@@ -453,6 +453,17 @@ class TestTimesheet(ERPNextTestSuite):
rate = get_timesheet_detail_rate(detail.name, timesheet.currency)
self.assertEqual(rate, detail.billing_amount)
def test_title_follows_employee(self):
first = make_employee("_test_timesheet_title_one@example.com", company="_Test Company")
second = make_employee("_test_timesheet_title_two@example.com", company="_Test Company")
timesheet = make_timesheet(first, simulate=True, do_not_submit=True)
self.assertEqual(timesheet.get_title(), frappe.db.get_value("Employee", first, "employee_name"))
timesheet.employee = second
timesheet.save()
self.assertEqual(timesheet.get_title(), frappe.db.get_value("Employee", second, "employee_name"))
@staticmethod
def _delete_if_exists(doctype, name):
if frappe.db.exists(doctype, name):

View File

@@ -49,7 +49,6 @@
"fields": [
{
"allow_on_submit": 1,
"default": "{employee_name}",
"fieldname": "title",
"fieldtype": "Data",
"hidden": 1,
@@ -315,7 +314,7 @@
"idx": 1,
"is_submittable": 1,
"links": [],
"modified": "2026-04-08 12:43:30.658074",
"modified": "2026-07-30 11:04:12.882140",
"modified_by": "Administrator",
"module": "Projects",
"name": "Timesheet",
@@ -409,5 +408,5 @@
"sort_field": "creation",
"sort_order": "ASC",
"states": [],
"title_field": "title"
"title_field": "employee_name"
}

View File

@@ -68,7 +68,6 @@
},
{
"allow_on_submit": 1,
"default": "{material_request_type}",
"fieldname": "title",
"fieldtype": "Data",
"hidden": 1,
@@ -377,7 +376,7 @@
"idx": 70,
"is_submittable": 1,
"links": [],
"modified": "2026-03-09 17:15:30.124509",
"modified": "2026-07-30 11:04:31.517204",
"modified_by": "Administrator",
"module": "Stock",
"name": "Material Request",