fix(Asset Repair): Replace 'Item Name' and 'Item Code' with 'Asset Name'

This commit is contained in:
GangaManoj 2021-05-10 23:08:12 +05:30
parent 322975a03c
commit 3e0e3f0e1b
3 changed files with 21 additions and 31 deletions

View File

@ -317,8 +317,7 @@ frappe.ui.form.on('Asset', {
frappe.call({
args: {
"asset": frm.doc.name,
"item_code": frm.doc.item_code,
"item_name": frm.doc.item_name
"asset_name": frm.doc.asset_name
},
method: "erpnext.assets.doctype.asset.asset.create_asset_repair",
callback: function(r) {

View File

@ -638,12 +638,11 @@ def create_asset_maintenance(asset, item_code, item_name, asset_category, compan
return asset_maintenance
@frappe.whitelist()
def create_asset_repair(asset, item_code, item_name):
def create_asset_repair(asset, asset_name):
asset_repair = frappe.new_doc("Asset Repair")
asset_repair.update({
"asset_name": asset,
"item_code": item_code,
"item_name": item_name
"asset": asset,
"asset_name": asset_name
})
return asset_repair

View File

@ -8,10 +8,9 @@
"engine": "InnoDB",
"field_order": [
"naming_series",
"asset_name",
"column_break_2",
"item_code",
"item_name",
"asset",
"asset_name",
"section_break_5",
"failure_date",
"assign_to",
@ -30,15 +29,6 @@
"amended_from"
],
"fields": [
{
"columns": 1,
"fieldname": "asset_name",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Asset",
"options": "Asset",
"reqd": 1
},
{
"fieldname": "naming_series",
"fieldtype": "Select",
@ -50,18 +40,6 @@
"fieldname": "column_break_2",
"fieldtype": "Column Break"
},
{
"fetch_from": "asset_name.item_code",
"fieldname": "item_code",
"fieldtype": "Read Only",
"label": "Item Code"
},
{
"fetch_from": "asset_name.item_name",
"fieldname": "item_name",
"fieldtype": "Read Only",
"label": "Item Name"
},
{
"fieldname": "section_break_5",
"fieldtype": "Section Break",
@ -159,12 +137,26 @@
"options": "Asset Repair",
"print_hide": 1,
"read_only": 1
},
{
"columns": 1,
"fieldname": "asset",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Asset",
"options": "Asset",
"reqd": 1
},
{
"fieldname": "asset_name",
"fieldtype": "Read Only",
"label": "Asset Name"
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2021-01-22 15:08:12.495850",
"modified": "2021-05-10 22:48:42.165513",
"modified_by": "Administrator",
"module": "Assets",
"name": "Asset Repair",