brotherton-erpnext/erpnext/public/js/hub/components/item_publish_dialog.js

40 lines
874 B
JavaScript
Raw Normal View History

function ItemPublishDialog(primary_action, secondary_action) {
2018-08-24 11:08:34 +00:00
let dialog = new frappe.ui.Dialog({
title: __('Edit Publishing Details'),
fields: [
{
2019-12-09 10:14:31 +00:00
label: __('Item Code'),
fieldname: 'item_code',
fieldtype: 'Data',
read_only: 1
2018-08-24 11:08:34 +00:00
},
{
2019-12-09 10:14:31 +00:00
label: __('Hub Category'),
fieldname: 'hub_category',
fieldtype: 'Autocomplete',
options: [],
reqd: 1
2018-08-24 11:08:34 +00:00
},
{
2019-12-09 10:14:31 +00:00
label: __('Images'),
fieldname: 'image_list',
fieldtype: 'MultiSelect',
options: [],
reqd: 1
2018-08-24 11:08:34 +00:00
}
],
primary_action_label: primary_action.label || __('Set Details'),
primary_action: primary_action.fn,
secondary_action: secondary_action.fn
});
2019-12-09 10:14:31 +00:00
hub.call('get_categories').then(categories => {
categories = categories.map(d => d.name);
dialog.fields_dict.hub_category.set_data(categories);
});
2018-08-24 11:08:34 +00:00
return dialog;
}
2019-12-09 10:14:31 +00:00
export { ItemPublishDialog };