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({ frappe.call({
args: { args: {
"asset": frm.doc.name, "asset": frm.doc.name,
"item_code": frm.doc.item_code, "asset_name": frm.doc.asset_name
"item_name": frm.doc.item_name
}, },
method: "erpnext.assets.doctype.asset.asset.create_asset_repair", method: "erpnext.assets.doctype.asset.asset.create_asset_repair",
callback: function(r) { callback: function(r) {

View File

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

View File

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