From 4837d8872e5454a911e069c3670b0c5f5734f49a Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Wed, 25 Aug 2021 22:25:29 +0530 Subject: [PATCH] fix: unable to create manual / auto asset depreciation entry when cost_center is mandatory (#26912) (#27149) Summary : unable to create manual / auto asset depreciation entry when cost_center is mandatory Reason: Though we are calculating value for depreciation_cost_center, it is not passed in credit_entry(it is passed in debit_entry) and this prevents creation of manual / auto asset depreciation entry when cost_center is mandatory Solution : pass already calculated depreciation_cost_center value in credit_entry (in line with, already done as in debit_entry) (cherry picked from commit b99c0119475ed82895f479f89685977204fcdbba) Co-authored-by: Ashish Shah --- erpnext/assets/doctype/asset/depreciation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/assets/doctype/asset/depreciation.py b/erpnext/assets/doctype/asset/depreciation.py index 8f0afb42b2c..251fe3fa493 100644 --- a/erpnext/assets/doctype/asset/depreciation.py +++ b/erpnext/assets/doctype/asset/depreciation.py @@ -59,7 +59,7 @@ def make_depreciation_entry(asset_name, date=None): "credit_in_account_currency": d.depreciation_amount, "reference_type": "Asset", "reference_name": asset.name, - "cost_center": "" + "cost_center": depreciation_cost_center } debit_entry = {