mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 11:09:17 +00:00
* fix: cannot cancel assets with repair pending
* fix: message
* Update asset.py
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
(cherry picked from commit 40847aeac3)
Co-authored-by: Saqib <nextchamp.saqib@gmail.com>
This commit is contained in:
@@ -407,6 +407,8 @@ class Asset(AccountsController):
|
|||||||
row.expected_value_after_useful_life = asset_value_after_full_schedule
|
row.expected_value_after_useful_life = asset_value_after_full_schedule
|
||||||
|
|
||||||
def validate_cancellation(self):
|
def validate_cancellation(self):
|
||||||
|
if self.status in ("In Maintenance", "Out of Order"):
|
||||||
|
frappe.throw(_("There are active maintenance or repairs against the asset. You must complete all of them before cancelling the asset."))
|
||||||
if self.status not in ("Submitted", "Partially Depreciated", "Fully Depreciated"):
|
if self.status not in ("Submitted", "Partially Depreciated", "Fully Depreciated"):
|
||||||
frappe.throw(_("Asset cannot be cancelled, as it is already {0}").format(self.status))
|
frappe.throw(_("Asset cannot be cancelled, as it is already {0}").format(self.status))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user