mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
fix(asset): validate depreciation accounts for depreciable asset upon creation
This commit is contained in:
@@ -426,12 +426,15 @@ class Asset(AccountsController):
|
|||||||
non_depreciable_category = frappe.db.get_value(
|
non_depreciable_category = frappe.db.get_value(
|
||||||
"Asset Category", self.asset_category, "non_depreciable_category"
|
"Asset Category", self.asset_category, "non_depreciable_category"
|
||||||
)
|
)
|
||||||
if self.calculate_depreciation and non_depreciable_category:
|
if self.calculate_depreciation:
|
||||||
frappe.throw(
|
if non_depreciable_category:
|
||||||
_(
|
frappe.throw(
|
||||||
"This asset category is marked as non-depreciable. Please disable depreciation calculation or choose a different category."
|
_(
|
||||||
|
"This asset category is marked as non-depreciable. Please disable depreciation calculation or choose a different category."
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
# validate accounts required for asset depreciation
|
||||||
|
get_depreciation_accounts(self.asset_category, self.company)
|
||||||
|
|
||||||
def validate_precision(self):
|
def validate_precision(self):
|
||||||
if self.net_purchase_amount:
|
if self.net_purchase_amount:
|
||||||
|
|||||||
Reference in New Issue
Block a user