chore: Add Prices, Stock and E-com Settings access from Website Item
(cherry picked from commit 065623ce25)
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Website Item', {
|
frappe.ui.form.on('Website Item', {
|
||||||
onload: function(frm) {
|
onload: (frm) => {
|
||||||
// should never check Private
|
// should never check Private
|
||||||
frm.fields_dict["website_image"].df.is_private = 0;
|
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");
|
refresh_field("image_view");
|
||||||
},
|
},
|
||||||
|
|
||||||
copy_from_item_group: function(frm) {
|
copy_from_item_group: (frm) => {
|
||||||
return frm.call({
|
return frm.call({
|
||||||
doc: frm.doc,
|
doc: frm.doc,
|
||||||
method: "copy_specification_from_item_group"
|
method: "copy_specification_from_item_group"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
set_meta_tags(frm) {
|
set_meta_tags: (frm) => {
|
||||||
frappe.utils.set_meta_tag(frm.doc.route);
|
frappe.utils.set_meta_tag(frm.doc.route);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user