feat: add return status

This commit is contained in:
Mihir Kandoi
2025-12-09 16:15:58 +05:30
parent e8f87927e1
commit ec3cd7e09c
3 changed files with 8 additions and 3 deletions

View File

@@ -181,7 +181,7 @@
"in_standard_filter": 1,
"label": "Status",
"no_copy": 1,
"options": "Draft\nOpen\nOngoing\nProduced\nDelivered\nCancelled\nClosed",
"options": "Draft\nOpen\nOngoing\nProduced\nDelivered\nReturned\nCancelled\nClosed",
"print_hide": 1,
"read_only": 1,
"reqd": 1,
@@ -306,7 +306,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2025-09-05 14:41:46.859510",
"modified": "2025-12-09 15:52:55.781346",
"modified_by": "Administrator",
"module": "Subcontracting",
"name": "Subcontracting Inward Order",

View File

@@ -51,7 +51,9 @@ class SubcontractingInwardOrder(SubcontractingController):
scrap_items: DF.Table[SubcontractingInwardOrderScrapItem]
service_items: DF.Table[SubcontractingInwardOrderServiceItem]
set_delivery_warehouse: DF.Link | None
status: DF.Literal["Draft", "Open", "Ongoing", "Produced", "Delivered", "Cancelled", "Closed"]
status: DF.Literal[
"Draft", "Open", "Ongoing", "Produced", "Delivered", "Returned", "Cancelled", "Closed"
]
title: DF.Data | None
transaction_date: DF.Date
# end: auto-generated types
@@ -111,6 +113,8 @@ class SubcontractingInwardOrder(SubcontractingController):
if self.docstatus == 1:
if self.status == "Draft":
status = "Open"
elif self.per_returned == 100:
status = "Returned"
elif self.per_delivered == 100:
status = "Delivered"
elif self.per_produced == 100:

View File

@@ -9,6 +9,7 @@ frappe.listview_settings["Subcontracting Inward Order"] = {
Ongoing: "yellow",
Produced: "blue",
Delivered: "green",
Returned: "grey",
Closed: "grey",
Cancelled: "red",
};