mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 23:19:20 +00:00
Merge pull request #50571 from aerele/fix/support-52685
fix: add cancelled option in status field
This commit is contained in:
@@ -371,7 +371,6 @@
|
|||||||
"label": "Other Details"
|
"label": "Other Details"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 1,
|
|
||||||
"default": "Draft",
|
"default": "Draft",
|
||||||
"fieldname": "status",
|
"fieldname": "status",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
@@ -379,7 +378,7 @@
|
|||||||
"in_standard_filter": 1,
|
"in_standard_filter": 1,
|
||||||
"label": "Status",
|
"label": "Status",
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "Draft\nSubmitted\nPartially Depreciated\nFully Depreciated\nSold\nScrapped\nIn Maintenance\nOut of Order\nIssue\nReceipt\nCapitalized\nWork In Progress",
|
"options": "Draft\nSubmitted\nCancelled\nPartially Depreciated\nFully Depreciated\nSold\nScrapped\nIn Maintenance\nOut of Order\nIssue\nReceipt\nCapitalized\nWork In Progress",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -597,7 +596,7 @@
|
|||||||
"link_fieldname": "target_asset"
|
"link_fieldname": "target_asset"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2025-10-23 22:43:33.634452",
|
"modified": "2025-11-17 18:01:51.417942",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Asset",
|
"name": "Asset",
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ class Asset(AccountsController):
|
|||||||
status: DF.Literal[
|
status: DF.Literal[
|
||||||
"Draft",
|
"Draft",
|
||||||
"Submitted",
|
"Submitted",
|
||||||
|
"Cancelled",
|
||||||
"Partially Depreciated",
|
"Partially Depreciated",
|
||||||
"Fully Depreciated",
|
"Fully Depreciated",
|
||||||
"Sold",
|
"Sold",
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Asset",
|
"label": "Asset",
|
||||||
"link_filters": "[[\"Asset\",\"status\",\"not in\",[\"Work In Progress\",\"Capitalized\",\"Fully Depreciated\",\"Sold\",\"Scrapped\",null]]]",
|
"link_filters": "[[\"Asset\",\"status\",\"not in\",[\"Work In Progress\",\"Capitalized\",\"Fully Depreciated\",\"Sold\",\"Scrapped\",\"Cancelled\",null]]]",
|
||||||
"options": "Asset",
|
"options": "Asset",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
@@ -250,7 +250,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-07-29 15:14:34.044564",
|
"modified": "2025-11-17 18:35:54.575265",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Asset Repair",
|
"name": "Asset Repair",
|
||||||
|
|||||||
@@ -60,6 +60,17 @@ class AssetRepair(AccountsController):
|
|||||||
if self.get("stock_items"):
|
if self.get("stock_items"):
|
||||||
self.set_stock_items_cost()
|
self.set_stock_items_cost()
|
||||||
self.calculate_total_repair_cost()
|
self.calculate_total_repair_cost()
|
||||||
|
self.validate_purchase_invoice_status()
|
||||||
|
|
||||||
|
def validate_purchase_invoice_status(self):
|
||||||
|
if self.purchase_invoice:
|
||||||
|
docstatus = frappe.db.get_value("Purchase Invoice", self.purchase_invoice, "docstatus")
|
||||||
|
if docstatus == 0:
|
||||||
|
frappe.throw(
|
||||||
|
_("{0} is still in Draft. Please submit it before saving the Asset Repair.").format(
|
||||||
|
get_link_to_form("Purchase Invoice", self.purchase_invoice)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
def validate_asset(self):
|
def validate_asset(self):
|
||||||
if self.asset_doc.status in ("Sold", "Fully Depreciated", "Scrapped"):
|
if self.asset_doc.status in ("Sold", "Fully Depreciated", "Scrapped"):
|
||||||
|
|||||||
Reference in New Issue
Block a user