fix: add return status for delivery note

This commit is contained in:
Pugazhendhi Velu
2025-12-03 13:10:22 +00:00
parent 6515bb04bf
commit dec67eecad
4 changed files with 7 additions and 4 deletions

View File

@@ -94,6 +94,7 @@ status_map = {
["To Bill", "eval:self.per_billed < 100 and self.docstatus == 1"],
["Completed", "eval:self.per_billed == 100 and self.docstatus == 1"],
["Return Issued", "eval:self.per_returned == 100 and self.docstatus == 1"],
["Return", "eval:self.is_return == 1 and self.per_billed == 0 and self.docstatus == 1"],
["Cancelled", "eval:self.docstatus==2"],
["Closed", "eval:self.status=='Closed' and self.docstatus != 2"],
],

View File

@@ -1070,7 +1070,7 @@
"no_copy": 1,
"oldfieldname": "status",
"oldfieldtype": "Select",
"options": "\nDraft\nTo Bill\nCompleted\nReturn Issued\nCancelled\nClosed",
"options": "\nDraft\nTo Bill\nCompleted\nReturn\nReturn Issued\nCancelled\nClosed",
"print_hide": 1,
"print_width": "150px",
"read_only": 1,
@@ -1433,7 +1433,7 @@
"idx": 146,
"is_submittable": 1,
"links": [],
"modified": "2025-08-04 19:20:47.724218",
"modified": "2025-12-02 23:55:25.415443",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",

View File

@@ -126,7 +126,9 @@ class DeliveryNote(SellingController):
shipping_address: DF.TextEditor | None
shipping_address_name: DF.Link | None
shipping_rule: DF.Link | None
status: DF.Literal["", "Draft", "To Bill", "Completed", "Return Issued", "Cancelled", "Closed"]
status: DF.Literal[
"", "Draft", "To Bill", "Completed", "Return", "Return Issued", "Cancelled", "Closed"
]
tax_category: DF.Link | None
tax_id: DF.Data | None
taxes: DF.Table[SalesTaxesandCharges]

View File

@@ -12,7 +12,7 @@ frappe.listview_settings["Delivery Note"] = {
"currency",
],
get_indicator: function (doc) {
if (cint(doc.is_return) == 1) {
if (cint(doc.is_return) == 1 && doc.status == "Return") {
return [__("Return"), "gray", "is_return,=,Yes"];
} else if (doc.status === "Closed") {
return [__("Closed"), "green", "status,=,Closed"];