From 41e7163476167bd674e3a06db0d8fcb6fe6177ff Mon Sep 17 00:00:00 2001 From: Ahmad M Abdelrahman Date: Wed, 5 Feb 2020 08:33:53 +0200 Subject: [PATCH 1/2] automatic booking of asset depreciation fix Stop Automatic deprecation is not working --- 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 ad671ba0f2..3be474cda6 100644 --- a/erpnext/assets/doctype/asset/depreciation.py +++ b/erpnext/assets/doctype/asset/depreciation.py @@ -10,7 +10,7 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import g def post_depreciation_entries(date=None): # Return if automatic booking of asset depreciation is disabled - if not cint(frappe.db.get_value("Accounts Settings", None, "book_asset_depreciation_entry_automatically")): + if cint(frappe.db.get_single_value("Accounts Settings", "book_asset_depreciation_entry_automatically"))==0: return if not date: From 97669e975d0fdf782ad627b959ba9e6129c64fcb Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Tue, 11 Feb 2020 10:18:39 +0530 Subject: [PATCH 2/2] fix: Update condition --- 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 3be474cda6..522c1fef67 100644 --- a/erpnext/assets/doctype/asset/depreciation.py +++ b/erpnext/assets/doctype/asset/depreciation.py @@ -10,7 +10,7 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import g def post_depreciation_entries(date=None): # Return if automatic booking of asset depreciation is disabled - if cint(frappe.db.get_single_value("Accounts Settings", "book_asset_depreciation_entry_automatically"))==0: + if not cint(frappe.db.get_single_value("Accounts Settings", "book_asset_depreciation_entry_automatically")): return if not date: