Renamed asset adjustment to asset value adjustment (#14532)

This commit is contained in:
rohitwaghchaure 2018-06-15 13:06:28 +05:30 committed by Nabin Hait
parent fcaeea70d2
commit e647c1f3cb
12 changed files with 47 additions and 24 deletions

View File

@ -126,7 +126,7 @@ class JournalEntry(AccountsController):
"inter_company_journal_entry_reference", "")
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)
def validate_party(self):

View File

@ -81,7 +81,7 @@ frappe.ui.form.on('Asset', {
}, __("Make"));
}
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");
}, __("Make"));
}

View File

@ -434,7 +434,7 @@ def create_asset_maintenance(asset, item_code, item_name, asset_category, compan
@frappe.whitelist()
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": asset,
"company": company,

View File

@ -1,7 +1,7 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Asset Adjustment', {
frappe.ui.form.on('Asset Value Adjustment', {
setup: function(frm) {
frm.add_fetch('company', 'cost_center', 'cost_center');
frm.set_query('cost_center', function() {

View File

@ -14,6 +14,7 @@
"fields": [
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -41,11 +42,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -73,16 +75,17 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_from": "asset.asset_category",
"fetch_from": "asset.asset_category",
"fieldname": "asset_category",
"fieldtype": "Read Only",
"hidden": 0,
@ -106,11 +109,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -138,11 +142,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -170,11 +175,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -200,11 +206,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -231,11 +238,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -262,11 +270,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -293,11 +302,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -329,6 +339,7 @@
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -361,6 +372,7 @@
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@ -377,7 +389,7 @@
"label": "Amended From",
"length": 0,
"no_copy": 1,
"options": "Asset Adjustment",
"options": "Asset Value Adjustment",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
@ -387,7 +399,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"translatable": 0,
"unique": 0
}
],
@ -401,10 +413,10 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-05-17 12:12:38.110774",
"modified": "2018-06-15 11:48:52.880894",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset Adjustment",
"name": "Asset Value Adjustment",
"name_case": "",
"owner": "Administrator",
"permissions": [

View File

@ -9,7 +9,7 @@ from frappe.utils import flt, getdate, cint, date_diff
from erpnext.assets.doctype.asset.depreciation import get_depreciation_accounts
from frappe.model.document import Document
class AssetAdjustment(Document):
class AssetValueAdjustment(Document):
def validate(self):
self.set_difference_amount()
self.set_current_asset_value()

View File

@ -2,15 +2,15 @@
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Asset Adjustment", function (assert) {
QUnit.test("test: Asset Value Adjustment", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Asset Adjustment
() => frappe.tests.make('Asset Adjustment', [
// insert a new Asset Value Adjustment
() => frappe.tests.make('Asset Value Adjustment', [
// values to be set
{key: 'value'}
]),

View File

@ -6,5 +6,5 @@ from __future__ import unicode_literals
import frappe
import unittest
class TestAssetAdjustment(unittest.TestCase):
class TestAssetValueAdjustment(unittest.TestCase):
pass

View File

@ -45,7 +45,7 @@ def get_data():
},
{
"type": "doctype",
"name": "Asset Adjustment",
"name": "Asset Value Adjustment",
},
{
"type": "doctype",

View File

@ -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_sales_partner_type
erpnext.patches.v11_0.add_hra_fields_for_india
erpnext.patches.v11_0.rename_asset_adjustment_doctype

View 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')