chore: Add Prices, Stock and E-com Settings access from Website Item

This commit is contained in:
marination 2022-04-05 12:30:02 +05:30
parent d4301d6d2f
commit 065623ce25

View File

@ -2,7 +2,7 @@
// For license information, please see license.txt
frappe.ui.form.on('Website Item', {
onload: function(frm) {
onload: (frm) => {
// should never check Private
frm.fields_dict["website_image"].df.is_private = 0;
@ -13,18 +13,35 @@ frappe.ui.form.on('Website Item', {
});
},
image: function() {
refresh: (frm) => {
frm.add_custom_button(__("Prices"), function() {
frappe.set_route("List", "Item Price", {"item_code": frm.doc.item_code});
}, __("View"));
frm.add_custom_button(__("Stock"), function() {
frappe.route_options = {
"item_code": frm.doc.item_code
};
frappe.set_route("query-report", "Stock Balance");
}, __("View"));
frm.add_custom_button(__("E Commerce Settings"), function() {
frappe.set_route("Form", "E Commerce Settings");
}, __("View"));
},
image: () => {
refresh_field("image_view");
},
copy_from_item_group: function(frm) {
copy_from_item_group: (frm) => {
return frm.call({
doc: frm.doc,
method: "copy_specification_from_item_group"
});
},
set_meta_tags(frm) {
set_meta_tags: (frm) => {
frappe.utils.set_meta_tag(frm.doc.route);
}
});