From 9a607b9bd072b3496e865ec188581dc016dca899 Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Sat, 25 Feb 2023 21:17:18 +0530 Subject: [PATCH] chore: should prepare schedule if not draft (cherry picked from commit 75386e3653657ec26d444b73e3032cbf51f123c3) --- erpnext/assets/doctype/asset/asset.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index b2d1c7349bb..15c20a59a88 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -99,6 +99,9 @@ class Asset(AccountsController): old_asset_doc = self.get_doc_before_save() + if not old_asset_doc: + return True + if ( old_asset_doc.gross_purchase_amount != self.gross_purchase_amount or old_asset_doc.opening_accumulated_depreciation != self.opening_accumulated_depreciation