mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 02:01:21 +00:00
chore: handle change in opening_accumulated_depreciation properly
This commit is contained in:
@@ -302,10 +302,6 @@ frappe.ui.form.on('Asset', {
|
|||||||
// frm.toggle_reqd("next_depreciation_date", (!frm.doc.is_existing_asset && frm.doc.calculate_depreciation));
|
// 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) {
|
make_schedules_editable: function(frm) {
|
||||||
if (frm.doc.finance_books) {
|
if (frm.doc.finance_books) {
|
||||||
var is_editable = frm.doc.finance_books.filter(d => d.depreciation_method == "Manual").length > 0
|
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.value_after_depreciation = 0
|
||||||
self.set_depreciation_rate()
|
self.set_depreciation_rate()
|
||||||
if not (
|
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.make_depreciation_schedule(date_of_disposal)
|
||||||
self.set_accumulated_depreciation(date_of_disposal, date_of_return)
|
self.set_accumulated_depreciation(date_of_disposal, date_of_return)
|
||||||
|
|||||||
Reference in New Issue
Block a user