mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-03 16:40:19 +00:00
refactor: Replace Class.extend with native class
This commit is contained in:
@@ -36,8 +36,8 @@ frappe.ui.form.on("Warranty Claim", {
|
||||
}
|
||||
});
|
||||
|
||||
erpnext.support.WarrantyClaim = frappe.ui.form.Controller.extend({
|
||||
refresh: function() {
|
||||
erpnext.support.WarrantyClaim = class WarrantyClaim extends frappe.ui.form.Controller {
|
||||
refresh() {
|
||||
frappe.dynamic_link = {doc: this.frm.doc, fieldname: 'customer', doctype: 'Customer'}
|
||||
|
||||
if(!cur_frm.doc.__islocal &&
|
||||
@@ -45,15 +45,15 @@ erpnext.support.WarrantyClaim = frappe.ui.form.Controller.extend({
|
||||
cur_frm.add_custom_button(__('Maintenance Visit'),
|
||||
this.make_maintenance_visit);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
make_maintenance_visit: function() {
|
||||
make_maintenance_visit() {
|
||||
frappe.model.open_mapped_doc({
|
||||
method: "erpnext.support.doctype.warranty_claim.warranty_claim.make_maintenance_visit",
|
||||
frm: cur_frm
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$.extend(cur_frm.cscript, new erpnext.support.WarrantyClaim({frm: cur_frm}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user