From efe9926bb43a75d284984e2b2ebeb00b0b21ece8 Mon Sep 17 00:00:00 2001 From: GangaManoj Date: Tue, 21 Sep 2021 07:04:39 +0530 Subject: [PATCH] fix: Add depreciation_schedule details in create_asset() (cherry picked from commit 249672c35db9278e1c4027b2331e1b6b5ef8f7d2) --- erpnext/assets/doctype/asset/test_asset.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/erpnext/assets/doctype/asset/test_asset.py b/erpnext/assets/doctype/asset/test_asset.py index 0b5e41ee7ef..9424d626031 100644 --- a/erpnext/assets/doctype/asset/test_asset.py +++ b/erpnext/assets/doctype/asset/test_asset.py @@ -729,9 +729,8 @@ def create_asset(**args): "calculate_depreciation": args.calculate_depreciation or 0, "gross_purchase_amount": 100000, "purchase_receipt_amount": 100000, - "expected_value_after_useful_life": 10000, "warehouse": args.warehouse or "_Test Warehouse - _TC", - "available_for_use_date": "2020-06-06", + "available_for_use_date": args.available_for_use_date or "2020-06-06", "location": "Test Location", "asset_owner": "Company", "is_existing_asset": 1 @@ -740,8 +739,10 @@ def create_asset(**args): if asset.calculate_depreciation: asset.append("finance_books", { "depreciation_method": "Straight Line", - "frequency_of_depreciation": 12, - "total_number_of_depreciations": 5 + "frequency_of_depreciation": args.frequency_of_depreciation or 12, + "total_number_of_depreciations": args.total_number_of_depreciations or 5, + "expected_value_after_useful_life": args.expected_value_after_useful_life or 0, + "depreciation_start_date": args.depreciation_start_date }) try: