chore: handle change in opening_accumulated_depreciation properly
(cherry picked from commit b0d670a51d)
This commit is contained in:
@@ -296,10 +296,6 @@ frappe.ui.form.on('Asset', {
|
||||
// frm.toggle_reqd("next_depreciation_date", (!frm.doc.is_existing_asset && frm.doc.calculate_depreciation));
|
||||
},
|
||||
|
||||
opening_accumulated_depreciation: function(frm) {
|
||||
erpnext.asset.set_accumulated_depreciation(frm);
|
||||
},
|
||||
|
||||
make_schedules_editable: function(frm) {
|
||||
if (frm.doc.finance_books) {
|
||||
var is_editable = frm.doc.finance_books.filter(d => d.depreciation_method == "Manual").length > 0
|
||||
|
||||
@@ -85,7 +85,10 @@ class Asset(AccountsController):
|
||||
self.value_after_depreciation = 0
|
||||
self.set_depreciation_rate()
|
||||
if not (
|
||||
self.get("schedules") and "Manual" in [d.depreciation_method for d in self.finance_books]
|
||||
self.get("schedules")
|
||||
and "Manual" in [d.depreciation_method for d in self.finance_books]
|
||||
and self.get_doc_before_save().opening_accumulated_depreciation
|
||||
== self.opening_accumulated_depreciation
|
||||
):
|
||||
self.make_depreciation_schedule(date_of_disposal)
|
||||
self.set_accumulated_depreciation(date_of_disposal, date_of_return)
|
||||
|
||||
Reference in New Issue
Block a user