mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
Merge pull request #6481 from rohitwaghchaure/fix_homepage
Fixed view button functionality in homepage
This commit is contained in:
@@ -2,6 +2,14 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Homepage', {
|
frappe.ui.form.on('Homepage', {
|
||||||
|
setup: function(frm) {
|
||||||
|
frm.fields_dict["products"].grid.get_field("item_code").get_query = function(){
|
||||||
|
return {
|
||||||
|
filters: {'show_in_website': 1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -35,5 +43,12 @@ frappe.ui.form.on('Homepage Featured Product', {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
view: function(frm, cdt, cdn){
|
||||||
|
var child= locals[cdt][cdn]
|
||||||
|
if(child.item_code && frm.doc.products_url){
|
||||||
|
window.location.href = frm.doc.products_url + '/' + encodeURIComponent(child.item_code);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user