mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 09:43:49 +00:00
fix: missing attribute error when restoring asset
This commit is contained in:
@@ -530,6 +530,7 @@ def reset_depreciation_schedule(asset_doc, date, notes):
|
||||
|
||||
|
||||
def modify_depreciation_schedule_for_asset_repairs(asset, notes):
|
||||
# test
|
||||
asset_repairs = frappe.get_all(
|
||||
"Asset Repair", filters={"asset": asset.name}, fields=["name", "increase_in_asset_life"]
|
||||
)
|
||||
@@ -537,6 +538,7 @@ def modify_depreciation_schedule_for_asset_repairs(asset, notes):
|
||||
for repair in asset_repairs:
|
||||
if repair.increase_in_asset_life:
|
||||
asset_repair = frappe.get_doc("Asset Repair", repair.name)
|
||||
asset_repair.asset_doc = asset
|
||||
asset_repair.modify_depreciation_schedule()
|
||||
make_new_active_asset_depr_schedules_and_cancel_current_ones(asset, notes)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user