mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
feat: add login user to driver if available for notifications
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"actions": [],
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
@@ -16,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",
|
||||||
@@ -115,14 +117,23 @@
|
|||||||
"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",
|
||||||
"modified": "2022-06-28 10:29:14.151380",
|
"links": [],
|
||||||
|
"modified": "2024-01-23 21:47:12.507540",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Driver",
|
"name": "Driver",
|
||||||
"name_case": "Title Case",
|
"naming_rule": "By \"Naming Series\" field",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
@@ -180,6 +191,7 @@
|
|||||||
"show_name_in_global_search": 1,
|
"show_name_in_global_search": 1,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
"states": [],
|
||||||
"title_field": "full_name",
|
"title_field": "full_name",
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
||||||
@@ -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