refactor: use DocType Fetch From
instead of frm.add_fetch
This commit is contained in:
parent
1763824e5f
commit
01044ca8e9
@ -8,17 +8,6 @@ frappe.ui.form.on("Warranty Claim", {
|
||||
frm.set_query('contact_person', erpnext.queries.contact_query);
|
||||
frm.set_query('customer_address', erpnext.queries.address_query);
|
||||
frm.set_query('customer', erpnext.queries.customer);
|
||||
|
||||
frm.add_fetch('serial_no', 'item_code', 'item_code');
|
||||
frm.add_fetch('serial_no', 'item_name', 'item_name');
|
||||
frm.add_fetch('serial_no', 'description', 'description');
|
||||
frm.add_fetch('serial_no', 'maintenance_status', 'warranty_amc_status');
|
||||
frm.add_fetch('serial_no', 'warranty_expiry_date', 'warranty_expiry_date');
|
||||
frm.add_fetch('serial_no', 'amc_expiry_date', 'amc_expiry_date');
|
||||
frm.add_fetch('serial_no', 'customer', 'customer');
|
||||
frm.add_fetch('serial_no', 'customer_name', 'customer_name');
|
||||
frm.add_fetch('item_code', 'item_name', 'item_name');
|
||||
frm.add_fetch('item_code', 'description', 'description');
|
||||
},
|
||||
|
||||
onload: (frm) => {
|
||||
|
@ -92,7 +92,8 @@
|
||||
"fieldname": "serial_no",
|
||||
"fieldtype": "Link",
|
||||
"label": "Serial No",
|
||||
"options": "Serial No"
|
||||
"options": "Serial No",
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "customer",
|
||||
@ -128,6 +129,8 @@
|
||||
"options": "fa fa-ticket"
|
||||
},
|
||||
{
|
||||
"fetch_from": "serial_no.item_code",
|
||||
"fetch_if_empty": 1,
|
||||
"fieldname": "item_code",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
@ -140,6 +143,7 @@
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.item_code",
|
||||
"fetch_from": "item_code.item_name",
|
||||
"fieldname": "item_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Item Name",
|
||||
@ -149,6 +153,7 @@
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.item_code",
|
||||
"fetch_from": "item_code.description",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Description",
|
||||
@ -164,17 +169,24 @@
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"fetch_from": "serial_no.maintenance_status",
|
||||
"fetch_if_empty": 1,
|
||||
"fieldname": "warranty_amc_status",
|
||||
"fieldtype": "Select",
|
||||
"label": "Warranty / AMC Status",
|
||||
"options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC"
|
||||
"options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC",
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"fetch_from": "serial_no.warranty_expiry_date",
|
||||
"fetch_if_empty": 1,
|
||||
"fieldname": "warranty_expiry_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Warranty Expiry Date"
|
||||
},
|
||||
{
|
||||
"fetch_from": "serial_no.amc_expiry_date",
|
||||
"fetch_if_empty": 1,
|
||||
"fieldname": "amc_expiry_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "AMC Expiry Date"
|
||||
@ -225,6 +237,7 @@
|
||||
{
|
||||
"bold": 1,
|
||||
"depends_on": "customer",
|
||||
"fetch_from": "customer.customer_name",
|
||||
"fieldname": "customer_name",
|
||||
"fieldtype": "Data",
|
||||
"in_global_search": 1,
|
||||
@ -366,7 +379,7 @@
|
||||
"icon": "fa fa-bug",
|
||||
"idx": 1,
|
||||
"links": [],
|
||||
"modified": "2023-06-03 16:17:07.694449",
|
||||
"modified": "2023-11-28 17:30:35.676410",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Support",
|
||||
"name": "Warranty Claim",
|
||||
|
Loading…
x
Reference in New Issue
Block a user