mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-29 11:38:32 +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(
|
||||
"Asset Category", self.asset_category, "non_depreciable_category"
|
||||
)
|
||||
if self.calculate_depreciation and non_depreciable_category:
|
||||
frappe.throw(
|
||||
_(
|
||||
"This asset category is marked as non-depreciable. Please disable depreciation calculation or choose a different category."
|
||||
if self.calculate_depreciation:
|
||||
if non_depreciable_category:
|
||||
frappe.throw(
|
||||
_(
|
||||
"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):
|
||||
if self.net_purchase_amount:
|
||||
|
||||
Reference in New Issue
Block a user