Renamed asset adjustment to asset value adjustment (#14532)
This commit is contained in:
parent
fcaeea70d2
commit
e647c1f3cb
@ -126,7 +126,7 @@ class JournalEntry(AccountsController):
|
|||||||
"inter_company_journal_entry_reference", "")
|
"inter_company_journal_entry_reference", "")
|
||||||
|
|
||||||
def unlink_asset_adjustment_entry(self):
|
def unlink_asset_adjustment_entry(self):
|
||||||
frappe.db.sql(""" update `tabAsset Adjustment`
|
frappe.db.sql(""" update `tabAsset Value Adjustment`
|
||||||
set journal_entry = null where journal_entry = %s""", self.name)
|
set journal_entry = null where journal_entry = %s""", self.name)
|
||||||
|
|
||||||
def validate_party(self):
|
def validate_party(self):
|
||||||
|
|||||||
@ -81,7 +81,7 @@ frappe.ui.form.on('Asset', {
|
|||||||
}, __("Make"));
|
}, __("Make"));
|
||||||
}
|
}
|
||||||
if (frm.doc.status != 'Fully Depreciated') {
|
if (frm.doc.status != 'Fully Depreciated') {
|
||||||
frm.add_custom_button(__("Asset Adjustment"), function() {
|
frm.add_custom_button(__("Asset Value Adjustment"), function() {
|
||||||
frm.trigger("create_asset_adjustment");
|
frm.trigger("create_asset_adjustment");
|
||||||
}, __("Make"));
|
}, __("Make"));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -434,7 +434,7 @@ def create_asset_maintenance(asset, item_code, item_name, asset_category, compan
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_asset_adjustment(asset, asset_category, company):
|
def create_asset_adjustment(asset, asset_category, company):
|
||||||
asset_maintenance = frappe.new_doc("Asset Adjustment")
|
asset_maintenance = frappe.new_doc("Asset Value Adjustment")
|
||||||
asset_maintenance.update({
|
asset_maintenance.update({
|
||||||
"asset": asset,
|
"asset": asset,
|
||||||
"company": company,
|
"company": company,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Asset Adjustment', {
|
frappe.ui.form.on('Asset Value Adjustment', {
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.add_fetch('company', 'cost_center', 'cost_center');
|
frm.add_fetch('company', 'cost_center', 'cost_center');
|
||||||
frm.set_query('cost_center', function() {
|
frm.set_query('cost_center', function() {
|
||||||
@ -14,6 +14,7 @@
|
|||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@ -41,11 +42,12 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@ -73,16 +75,17 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
"columns": 0,
|
"columns": 0,
|
||||||
"fetch_from": "asset.asset_category",
|
"fetch_from": "asset.asset_category",
|
||||||
"fieldname": "asset_category",
|
"fieldname": "asset_category",
|
||||||
"fieldtype": "Read Only",
|
"fieldtype": "Read Only",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
@ -106,11 +109,12 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@ -138,11 +142,12 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@ -170,11 +175,12 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@ -200,11 +206,12 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@ -231,11 +238,12 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@ -262,11 +270,12 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@ -293,11 +302,12 @@
|
|||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@ -329,6 +339,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@ -361,6 +372,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"allow_bulk_edit": 0,
|
||||||
|
"allow_in_quick_entry": 0,
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
"collapsible": 0,
|
"collapsible": 0,
|
||||||
@ -377,7 +389,7 @@
|
|||||||
"label": "Amended From",
|
"label": "Amended From",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"options": "Asset Adjustment",
|
"options": "Asset Value Adjustment",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"print_hide": 1,
|
"print_hide": 1,
|
||||||
"print_hide_if_no_value": 0,
|
"print_hide_if_no_value": 0,
|
||||||
@ -387,7 +399,7 @@
|
|||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"translatable": 0,
|
"translatable": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -401,10 +413,10 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2018-05-17 12:12:38.110774",
|
"modified": "2018-06-15 11:48:52.880894",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Assets",
|
"module": "Assets",
|
||||||
"name": "Asset Adjustment",
|
"name": "Asset Value Adjustment",
|
||||||
"name_case": "",
|
"name_case": "",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
@ -9,7 +9,7 @@ from frappe.utils import flt, getdate, cint, date_diff
|
|||||||
from erpnext.assets.doctype.asset.depreciation import get_depreciation_accounts
|
from erpnext.assets.doctype.asset.depreciation import get_depreciation_accounts
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class AssetAdjustment(Document):
|
class AssetValueAdjustment(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.set_difference_amount()
|
self.set_difference_amount()
|
||||||
self.set_current_asset_value()
|
self.set_current_asset_value()
|
||||||
@ -2,15 +2,15 @@
|
|||||||
// rename this file from _test_[name] to test_[name] to activate
|
// rename this file from _test_[name] to test_[name] to activate
|
||||||
// and remove above this line
|
// and remove above this line
|
||||||
|
|
||||||
QUnit.test("test: Asset Adjustment", function (assert) {
|
QUnit.test("test: Asset Value Adjustment", function (assert) {
|
||||||
let done = assert.async();
|
let done = assert.async();
|
||||||
|
|
||||||
// number of asserts
|
// number of asserts
|
||||||
assert.expect(1);
|
assert.expect(1);
|
||||||
|
|
||||||
frappe.run_serially([
|
frappe.run_serially([
|
||||||
// insert a new Asset Adjustment
|
// insert a new Asset Value Adjustment
|
||||||
() => frappe.tests.make('Asset Adjustment', [
|
() => frappe.tests.make('Asset Value Adjustment', [
|
||||||
// values to be set
|
// values to be set
|
||||||
{key: 'value'}
|
{key: 'value'}
|
||||||
]),
|
]),
|
||||||
@ -6,5 +6,5 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class TestAssetAdjustment(unittest.TestCase):
|
class TestAssetValueAdjustment(unittest.TestCase):
|
||||||
pass
|
pass
|
||||||
@ -45,7 +45,7 @@ def get_data():
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "doctype",
|
"type": "doctype",
|
||||||
"name": "Asset Adjustment",
|
"name": "Asset Value Adjustment",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "doctype",
|
"type": "doctype",
|
||||||
|
|||||||
@ -550,3 +550,4 @@ erpnext.patches.v11_0.set_update_field_and_value_in_workflow_state
|
|||||||
erpnext.patches.v11_0.update_total_qty_field
|
erpnext.patches.v11_0.update_total_qty_field
|
||||||
erpnext.patches.v11_0.update_sales_partner_type
|
erpnext.patches.v11_0.update_sales_partner_type
|
||||||
erpnext.patches.v11_0.add_hra_fields_for_india
|
erpnext.patches.v11_0.add_hra_fields_for_india
|
||||||
|
erpnext.patches.v11_0.rename_asset_adjustment_doctype
|
||||||
|
|||||||
10
erpnext/patches/v11_0/rename_asset_adjustment_doctype.py
Normal file
10
erpnext/patches/v11_0/rename_asset_adjustment_doctype.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
import frappe
|
||||||
|
from frappe.model.rename_doc import rename_doc
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
if frappe.db.table_exists("Asset Adjustment") and not frappe.db.table_exists("Asset Value Adjustment"):
|
||||||
|
rename_doc('DocType', 'Asset Adjustment', 'Asset Value Adjustment', force=True)
|
||||||
|
frappe.reload_doc('assets', 'doctype', 'asset_value_adjustment')
|
||||||
Loading…
x
Reference in New Issue
Block a user