mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-15 15:45:01 +00:00
Merge pull request #39638 from blaggacao/feat/add-login-user-to-driver
feat: add login user to driver if available for notifications
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
"employee",
|
||||
"cell_number",
|
||||
"address",
|
||||
"user",
|
||||
"license_details",
|
||||
"license_number",
|
||||
"column_break_8",
|
||||
@@ -116,6 +117,14 @@
|
||||
"fieldtype": "Link",
|
||||
"label": "Address",
|
||||
"options": "Address"
|
||||
},
|
||||
{
|
||||
"fieldname": "user",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "User",
|
||||
"options": "User",
|
||||
"read_only_depends_on": "employee"
|
||||
}
|
||||
],
|
||||
"icon": "fa fa-user",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
@@ -31,4 +31,6 @@ class Driver(Document):
|
||||
transporter: DF.Link | None
|
||||
# end: auto-generated types
|
||||
|
||||
pass
|
||||
def validate(self):
|
||||
if self.employee:
|
||||
self.user = frappe.get_value("Employee", self.employee, "user_id")
|
||||
|
||||
Reference in New Issue
Block a user