diff --git a/erpnext/assets/doctype/asset/asset.py b/erpnext/assets/doctype/asset/asset.py index 247dc10972c..cef5b0abb93 100644 --- a/erpnext/assets/doctype/asset/asset.py +++ b/erpnext/assets/doctype/asset/asset.py @@ -40,7 +40,7 @@ class Asset(AccountsController): self.validate_cancellation() self.delete_depreciation_entries() self.set_status() - delete_gl_entries() + delete_gl_entries(voucher_type='Asset', voucher_no=self.name) self.db_set('booked_fixed_asset', 0) def validate_item(self): diff --git a/erpnext/assets/doctype/asset/test_asset.py b/erpnext/assets/doctype/asset/test_asset.py index 3f706f8b644..4ee4894f043 100644 --- a/erpnext/assets/doctype/asset/test_asset.py +++ b/erpnext/assets/doctype/asset/test_asset.py @@ -31,7 +31,7 @@ class TestAsset(unittest.TestCase): self.assertEqual(asset.purchase_invoice, pi.name) expected_gle = ( - ("_Test Fixed Asset - _TC", 100000.0, 0.0), + ("Asset Received But Not Billed - _TC", 100000.0, 0.0), ("Creditors - _TC", 0.0, 100000.0) ) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 7adb38ea67f..ff0d134d811 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -152,8 +152,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ onload: function() { var me = this; - this.setup_quality_inspection(); - if(this.frm.doc.__islocal) { var currency = frappe.defaults.get_user_default("currency"); @@ -230,6 +228,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ erpnext.hide_company(); this.set_dynamic_labels(); this.setup_sms(); + this.setup_quality_inspection(); }, apply_default_taxes: function() { diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 359d8347d21..e468533b8a7 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -59,7 +59,6 @@ frappe.ui.form.on('Stock Entry', { }); frm.add_fetch("bom_no", "inspection_required", "inspection_required"); - frm.trigger("setup_quality_inspection"); }, setup_quality_inspection: function(frm) { @@ -189,6 +188,8 @@ frappe.ui.form.on('Stock Entry', { frm.trigger("make_retention_stock_entry"); }); } + + frm.trigger("setup_quality_inspection"); }, purpose: function(frm) {