fix: don't depreciate assets with no schedule on scrapping (#38276)
fix: don't depreciate non-depreciable assets on scrapping
(cherry picked from commit 816b1b6bd5)
Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
This commit is contained in:
@@ -509,6 +509,9 @@ def restore_asset(asset_name):
|
||||
|
||||
|
||||
def depreciate_asset(asset_doc, date, notes):
|
||||
if not asset_doc.calculate_depreciation:
|
||||
return
|
||||
|
||||
asset_doc.flags.ignore_validate_update_after_submit = True
|
||||
|
||||
make_new_active_asset_depr_schedules_and_cancel_current_ones(
|
||||
@@ -521,6 +524,9 @@ def depreciate_asset(asset_doc, date, notes):
|
||||
|
||||
|
||||
def reset_depreciation_schedule(asset_doc, date, notes):
|
||||
if not asset_doc.calculate_depreciation:
|
||||
return
|
||||
|
||||
asset_doc.flags.ignore_validate_update_after_submit = True
|
||||
|
||||
make_new_active_asset_depr_schedules_and_cancel_current_ones(
|
||||
|
||||
Reference in New Issue
Block a user