Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,4 @@ jobs:
- name: Install and run pip-audit
run: |
pip install pip-audit
cd ${GITHUB_WORKSPACE}
pip-audit --desc on .
pip-audit -r requirements.txt --desc on
4 changes: 3 additions & 1 deletion vsd_fleet_ms/patches.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[pre_model_sync]
vsd_fleet_ms.patches.workspace.rename_fleet_ms_workspace

[post_model_sync]
vsd_fleet_ms.patches.custom_fields.add_cargo_id_custom_field_on_sales_invoice_item
vsd_fleet_ms.patches.custom_fields.add_bill_uom_field_in_cargo_detail
vsd_fleet_ms.patches.custom_fields.add_allow_bill_on_weight
vsd_fleet_ms.patches.property_setters.create_property_setter_cargo_details

vsd_fleet_ms.patches.reports.remove_legacy_invoice_reports
vsd_fleet_ms.patches.workspace.sync_fleet_management_workspace
1 change: 1 addition & 0 deletions vsd_fleet_ms/patches/reports/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

7 changes: 7 additions & 0 deletions vsd_fleet_ms/patches/reports/remove_legacy_invoice_reports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import frappe


def execute():
for report in ("Unpaid Invoices Report", "Overdue Invoices Report"):
if frappe.db.exists("Report", report):
frappe.delete_doc("Report", report, force=True, ignore_permissions=True)
32 changes: 32 additions & 0 deletions vsd_fleet_ms/patches/workspace/rename_fleet_ms_workspace.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import glob
import os

import frappe
from frappe.modules.import_file import import_file_by_path


def execute():
"""Bring any site's Fleet MS workspace in line with the new Fleet Management layout.

Runs in pre_model_sync so the rename happens before the standard fixture sync
tries to import the "Fleet Management" workspace file - otherwise a site that
still has the old "Fleet MS" doc would end up with both, side by side.
"""
if frappe.db.exists("Workspace", "Fleet MS") and not frappe.db.exists("Workspace", "Fleet Management"):
frappe.rename_doc("Workspace", "Fleet MS", "Fleet Management", ignore_permissions=True)
frappe.db.set_value("Workspace", "Fleet Management", "label", "Fleet Management")

frappe.flags.in_migrate = True
for old_report in ("Fuel Expense By Trip", "Truck Status Report"):
if frappe.db.exists("Report", old_report):
frappe.delete_doc("Report", old_report, force=True, ignore_permissions=True)

# Number Card fixtures for this app are not picked up by the generic module sync
# (frappe.model.sync only scans a fixed doctype list that excludes "number_card"
# for non-core apps), so import them explicitly here - before the workspace
# fixture syncs and tries to link to them.
app_path = frappe.get_app_path("vsd_fleet_ms", "vsd_fleet_ms")
for path in sorted(glob.glob(os.path.join(app_path, "number_card", "*", "*.json"))):
import_file_by_path(path, force=True)

frappe.db.commit()
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import frappe
from frappe.modules.import_file import import_file_by_path


def execute():
path = frappe.get_app_path("vsd_fleet_ms", "vsd_fleet_ms", "workspace", "fleet_management", "fleet_management.json")
import_file_by_path(path, force=True)
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"background_color": "#e6f6ea",
"color": "#2e9e4f",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Truck",
"filters_json": "[[\"Truck\", \"status\", \"=\", \"Idle\", false]]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Available Truck",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Available Truck",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"background_color": "#e0f7f7",
"color": "#16a3a3",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Cargo Registration",
"filters_json": "[]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Cargo Registrations",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Cargo Registrations",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"background_color": "#e6f6ea",
"color": "#2e9e4f",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Trips",
"filters_json": "[[\"Trips\", \"trip_status\", \"=\", \"Completed\", false]]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Completed Trips",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Completed Trips",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"background_color": "#fdf1df",
"color": "#e0891e",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Fuel Requests",
"filters_json": "[[\"Fuel Requests\", \"status\", \"!=\", \"Fully Processed\", false]]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Fuel Requests",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Fuel Requests",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
22 changes: 22 additions & 0 deletions vsd_fleet_ms/vsd_fleet_ms/number_card/manifest/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"background_color": "#f1e9fb",
"color": "#8258d1",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Manifest",
"filters_json": "[]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Manifest",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Manifest",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"background_color": "#e5f0fd",
"color": "#2f6fed",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Trips",
"filters_json": "[[\"Trips\", \"trip_status\", \"=\", \"Pending\", false]]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Ongoing Trips",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Ongoing Trips",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"background_color": "#fbe7ea",
"color": "#c0293f",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Sales Invoice",
"dynamic_filters_json": "[[\"Sales Invoice\", \"due_date\", \"<\", \"frappe.datetime.get_today()\"]]",
"filters_json": "[[\"Sales Invoice\", \"docstatus\", \"=\", \"1\", false], [\"Sales Invoice\", \"outstanding_amount\", \">\", \"0\", false]]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Overdue Sales Invoices",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Overdue Sales Invoices",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"background_color": "#fbe7ea",
"color": "#c0293f",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Requested Payment",
"filters_json": "[[\"Requested Payment\", \"payment_status\", \"!=\", \"Paid\", false]]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Requested Payments In Trip",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Requested Payments In Trip",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
22 changes: 22 additions & 0 deletions vsd_fleet_ms/vsd_fleet_ms/number_card/total_trips/total_trips.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"background_color": "#e6e9f5",
"color": "#3f51b5",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Trips",
"filters_json": "[]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Total Trips",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Total Trips",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"background_color": "#e6e9f5",
"color": "#3f51b5",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Truck",
"filters_json": "[]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Total Trucks",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Total Trucks",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"background_color": "#e5f0fd",
"color": "#2f6fed",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Truck",
"filters_json": "[[\"Truck\", \"status\", \"=\", \"On Trip\", false]]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Truck On Trip",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Truck On Trip",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"background_color": "#fdf1df",
"color": "#c0293f",
"creation": "2026-09-17 09:00:00.000000",
"docstatus": 0,
"doctype": "Number Card",
"document_type": "Sales Invoice",
"filters_json": "[[\"Sales Invoice\", \"docstatus\", \"=\", \"1\", false], [\"Sales Invoice\", \"outstanding_amount\", \">\", \"0\", false]]",
"function": "Count",
"idx": 0,
"is_public": 1,
"is_standard": 1,
"label": "Unpaid Sales Invoices",
"modified": "2026-09-17 09:00:00.000000",
"modified_by": "Administrator",
"module": "VSD Fleet MS",
"name": "Unpaid Sales Invoices",
"owner": "Administrator",
"show_percentage_stats": 0,
"stats_time_interval": "Weekly",
"type": "Document Type"
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) 2026, VV SYSTEMS DEVELOPER LTD and contributors
// For license information, please see license.txt
/* eslint-disable */

frappe.query_reports["Completed Trips Report"] = {
"filters": [
{
"fieldname": "truck_number",
"label": __("Truck"),
"fieldtype": "Link",
"options": "Truck"
},
{
"fieldname": "from_date",
"label": __("From Date"),
"fieldtype": "Date",
"default": frappe.datetime.month_start()
},
{
"fieldname": "to_date",
"label": __("To Date"),
"fieldtype": "Date",
"default": frappe.datetime.now_date()
}
]
};
Loading
Loading