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):
|
def modify_depreciation_schedule_for_asset_repairs(asset, notes):
|
||||||
|
# test
|
||||||
asset_repairs = frappe.get_all(
|
asset_repairs = frappe.get_all(
|
||||||
"Asset Repair", filters={"asset": asset.name}, fields=["name", "increase_in_asset_life"]
|
"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:
|
for repair in asset_repairs:
|
||||||
if repair.increase_in_asset_life:
|
if repair.increase_in_asset_life:
|
||||||
asset_repair = frappe.get_doc("Asset Repair", repair.name)
|
asset_repair = frappe.get_doc("Asset Repair", repair.name)
|
||||||
|
asset_repair.asset_doc = asset
|
||||||
asset_repair.modify_depreciation_schedule()
|
asset_repair.modify_depreciation_schedule()
|
||||||
make_new_active_asset_depr_schedules_and_cancel_current_ones(asset, notes)
|
make_new_active_asset_depr_schedules_and_cancel_current_ones(asset, notes)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user