Skip to content

Commit

Permalink
driver and vehicle doctype
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalutu committed Jan 2, 2025
1 parent 3304263 commit 67e939c
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 2 deletions.
11 changes: 10 additions & 1 deletion rentals/rentals/doctype/driver/driver.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"actions": [],
"allow_import": 1,
"allow_rename": 1,
"autoname": "format:DR-{###}",
"creation": "2025-01-02 16:49:55.016997",
Expand All @@ -8,6 +9,7 @@
"field_order": [
"first_name",
"last_name",
"full_name",
"column_break_etkh",
"license_number",
"phone_number",
Expand Down Expand Up @@ -46,11 +48,18 @@
{
"fieldname": "column_break_etkh",
"fieldtype": "Column Break"
},
{
"fieldname": "full_name",
"fieldtype": "Data",
"label": "Full Name",
"read_only": 1
}
],
"image_field": "profile_image",
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-01-02 16:58:25.364403",
"modified": "2025-01-02 19:49:28.016131",
"modified_by": "Administrator",
"module": "Rentals",
"name": "Driver",
Expand Down
3 changes: 2 additions & 1 deletion rentals/rentals/doctype/driver/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@


class Driver(Document):
pass
def before_save(self):
self.full_name = f"{self.first_name} {self.last_name}"
Empty file.
30 changes: 30 additions & 0 deletions rentals/rentals/doctype/vehicle/test_vehicle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2025, Kalutu and Contributors
# See license.txt

# import frappe
from frappe.tests import IntegrationTestCase, UnitTestCase


# On IntegrationTestCase, the doctype test records and all
# link-field test record dependencies are recursively loaded
# Use these module variables to add/remove to/from that list
EXTRA_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]
IGNORE_TEST_RECORD_DEPENDENCIES = [] # eg. ["User"]


class UnitTestVehicle(UnitTestCase):
"""
Unit tests for Vehicle.
Use this class for testing individual functions and methods.
"""

pass


class IntegrationTestVehicle(IntegrationTestCase):
"""
Integration tests for Vehicle.
Use this class for testing interactions between multiple components.
"""

pass
8 changes: 8 additions & 0 deletions rentals/rentals/doctype/vehicle/vehicle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2025, Kalutu and contributors
// For license information, please see license.txt

// frappe.ui.form.on("Vehicle", {
// refresh(frm) {

// },
// });
82 changes: 82 additions & 0 deletions rentals/rentals/doctype/vehicle/vehicle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"actions": [],
"allow_import": 1,
"allow_rename": 1,
"autoname": "autoincrement",
"creation": "2025-01-02 17:12:25.961322",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"make",
"year",
"color",
"column_break_xqob",
"model",
"license_plate"
],
"fields": [
{
"fieldname": "make",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Make",
"reqd": 1
},
{
"fieldname": "year",
"fieldtype": "Int",
"in_list_view": 1,
"label": "Year",
"non_negative": 1,
"reqd": 1
},
{
"fieldname": "color",
"fieldtype": "Data",
"label": "Color"
},
{
"fieldname": "column_break_xqob",
"fieldtype": "Column Break"
},
{
"fieldname": "model",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Model",
"reqd": 1
},
{
"fieldname": "license_plate",
"fieldtype": "Data",
"in_list_view": 1,
"label": "License Plate",
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-01-02 19:42:59.106321",
"modified_by": "Administrator",
"module": "Rentals",
"name": "Vehicle",
"naming_rule": "Autoincrement",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}
9 changes: 9 additions & 0 deletions rentals/rentals/doctype/vehicle/vehicle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2025, Kalutu and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class Vehicle(Document):
pass

0 comments on commit 67e939c

Please sign in to comment.