Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
926 B
JavaScript
Raw Normal View History

2019-12-19 20:11:37 +05:30
function edit_details_dialog(params) {
2019-12-02 01:09:59 +05:30
let dialog = new frappe.ui.Dialog({
title: __('Update Details'),
fields: [
{
2019-12-09 16:31:14 +05:30
label: 'Item Name',
fieldname: 'item_name',
fieldtype: 'Data',
2019-12-19 20:11:37 +05:30
default: params.defaults.item_name,
2019-12-09 16:31:14 +05:30
reqd: 1
2019-12-02 01:09:59 +05:30
},
{
2019-12-09 16:31:14 +05:30
label: 'Hub Category',
fieldname: 'hub_category',
fieldtype: 'Autocomplete',
2019-12-19 20:11:37 +05:30
default: params.defaults.hub_category,
2019-12-09 16:31:14 +05:30
options: [],
reqd: 1
2019-12-02 01:09:59 +05:30
},
{
2019-12-09 16:31:14 +05:30
label: 'Description',
fieldname: 'description',
fieldtype: 'Text',
2019-12-19 20:11:37 +05:30
default: params.defaults.description,
2019-12-09 16:31:14 +05:30
options: [],
reqd: 1
2019-12-02 01:09:59 +05:30
}
],
2019-12-19 20:11:37 +05:30
primary_action_label: params.primary_action.label || __('Update Details'),
primary_action: params.primary_action.fn
2019-12-02 01:09:59 +05:30
});
2019-12-09 16:31:14 +05:30
hub.call('get_categories').then(categories => {
categories = categories.map(d => d.name);
dialog.fields_dict.hub_category.set_data(categories);
});
2019-12-02 01:09:59 +05:30
return dialog;
}
2019-12-19 20:11:37 +05:30
export { edit_details_dialog };