mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-12 14:58:24 +00:00
fix: delivery trip driver is only required on submit (#35876)
This allows drafting trips and stops without yet deciding on the assignable driver which, in real life, may well be decided on after preparing and planning the trip.
This commit is contained in:
@@ -66,8 +66,7 @@
|
||||
"fieldname": "driver",
|
||||
"fieldtype": "Link",
|
||||
"label": "Driver",
|
||||
"options": "Driver",
|
||||
"reqd": 1
|
||||
"options": "Driver"
|
||||
},
|
||||
{
|
||||
"fetch_from": "driver.full_name",
|
||||
@@ -189,10 +188,11 @@
|
||||
],
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2021-04-30 21:21:36.610142",
|
||||
"modified": "2023-06-27 11:22:27.927637",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Delivery Trip",
|
||||
"naming_rule": "By \"Naming Series\" field",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
@@ -228,5 +228,6 @@
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"title_field": "driver_name"
|
||||
}
|
||||
@@ -24,6 +24,9 @@ class DeliveryTrip(Document):
|
||||
)
|
||||
|
||||
def validate(self):
|
||||
if self._action == "submit" and not self.driver:
|
||||
frappe.throw(_("A driver must be set to submit."))
|
||||
|
||||
self.validate_stop_addresses()
|
||||
|
||||
def on_submit(self):
|
||||
|
||||
Reference in New Issue
Block a user