fix: don't depreciate assets with no schedule on scrapping (#38276) fix: don't depreciate non-depreciable assets on scrapping (cherry picked from commit 816b1b6bd52b4f6adcb35d4039ad75892b0976ff) Co-authored-by: Anand Baburajan <anandbaburajan@gmail.com>
This commit is contained in:
parent
37d1f1ac67
commit
18613c595f
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user