fix: display new item value
This commit is contained in:
parent
015038236c
commit
ba48546678
@ -3,43 +3,39 @@ function EditDetailsDialog(primary_action, defaults) {
|
|||||||
title: __('Update Details'),
|
title: __('Update Details'),
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
"label": "Item Name",
|
label: 'Item Name',
|
||||||
"fieldname": "item_name",
|
fieldname: 'item_name',
|
||||||
"fieldtype": "Data",
|
fieldtype: 'Data',
|
||||||
"default": defaults.item_name,
|
default: defaults.item_name,
|
||||||
"reqd": 1
|
reqd: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Hub Category",
|
label: 'Hub Category',
|
||||||
"fieldname": "hub_category",
|
fieldname: 'hub_category',
|
||||||
"fieldtype": "Autocomplete",
|
fieldtype: 'Autocomplete',
|
||||||
"default": defaults.hub_category,
|
default: defaults.hub_category,
|
||||||
"options": [],
|
options: [],
|
||||||
"reqd": 1
|
reqd: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Description",
|
label: 'Description',
|
||||||
"fieldname": "description",
|
fieldname: 'description',
|
||||||
"fieldtype": "Text",
|
fieldtype: 'Text',
|
||||||
"default": defaults.description,
|
default: defaults.description,
|
||||||
"options": [],
|
options: [],
|
||||||
"reqd": 1
|
reqd: 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
primary_action_label: primary_action.label || __('Update Details'),
|
primary_action_label: primary_action.label || __('Update Details'),
|
||||||
primary_action: primary_action.fn,
|
primary_action: primary_action.fn
|
||||||
});
|
});
|
||||||
|
|
||||||
hub.call('get_categories')
|
hub.call('get_categories').then(categories => {
|
||||||
.then(categories => {
|
|
||||||
categories = categories.map(d => d.name);
|
categories = categories.map(d => d.name);
|
||||||
dialog.fields_dict.hub_category.df.options = categories;
|
dialog.fields_dict.hub_category.set_data(categories);
|
||||||
dialog.fields_dict.hub_category.set_options();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export { EditDetailsDialog };
|
||||||
EditDetailsDialog
|
|
||||||
};
|
|
||||||
|
|||||||
@ -311,7 +311,9 @@ export default {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then((r) => {
|
.then((r) => {
|
||||||
this.get_item_details();
|
return this.get_item_details();
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
frappe.show_alert(__(`${this.item.item_name} Updated`));
|
frappe.show_alert(__(`${this.item.item_name} Updated`));
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user