mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +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",
|
"employee",
|
||||||
"cell_number",
|
"cell_number",
|
||||||
"address",
|
"address",
|
||||||
|
"user",
|
||||||
"license_details",
|
"license_details",
|
||||||
"license_number",
|
"license_number",
|
||||||
"column_break_8",
|
"column_break_8",
|
||||||
@@ -116,6 +117,14 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Address",
|
"label": "Address",
|
||||||
"options": "Address"
|
"options": "Address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "user",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "User",
|
||||||
|
"options": "User",
|
||||||
|
"read_only_depends_on": "employee"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-user",
|
"icon": "fa fa-user",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
|
||||||
@@ -31,4 +31,6 @@ class Driver(Document):
|
|||||||
transporter: DF.Link | None
|
transporter: DF.Link | None
|
||||||
# end: auto-generated types
|
# 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