From ba48546678245b28d48880add9062494c8c3b8ed Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Mon, 9 Dec 2019 16:31:14 +0530 Subject: [PATCH] fix: display new item value --- .../js/hub/components/edit_details_dialog.js | 50 +++++++++---------- erpnext/public/js/hub/pages/Item.vue | 4 +- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/erpnext/public/js/hub/components/edit_details_dialog.js b/erpnext/public/js/hub/components/edit_details_dialog.js index b341901fec..e249ca5d7a 100644 --- a/erpnext/public/js/hub/components/edit_details_dialog.js +++ b/erpnext/public/js/hub/components/edit_details_dialog.js @@ -3,43 +3,39 @@ function EditDetailsDialog(primary_action, defaults) { title: __('Update Details'), fields: [ { - "label": "Item Name", - "fieldname": "item_name", - "fieldtype": "Data", - "default": defaults.item_name, - "reqd": 1 + label: 'Item Name', + fieldname: 'item_name', + fieldtype: 'Data', + default: defaults.item_name, + reqd: 1 }, { - "label": "Hub Category", - "fieldname": "hub_category", - "fieldtype": "Autocomplete", - "default": defaults.hub_category, - "options": [], - "reqd": 1 + label: 'Hub Category', + fieldname: 'hub_category', + fieldtype: 'Autocomplete', + default: defaults.hub_category, + options: [], + reqd: 1 }, { - "label": "Description", - "fieldname": "description", - "fieldtype": "Text", - "default": defaults.description, - "options": [], - "reqd": 1 + label: 'Description', + fieldname: 'description', + fieldtype: 'Text', + default: defaults.description, + options: [], + reqd: 1 } ], primary_action_label: primary_action.label || __('Update Details'), - primary_action: primary_action.fn, + primary_action: primary_action.fn }); - hub.call('get_categories') - .then(categories => { - categories = categories.map(d => d.name); - dialog.fields_dict.hub_category.df.options = categories; - dialog.fields_dict.hub_category.set_options(); - }); + hub.call('get_categories').then(categories => { + categories = categories.map(d => d.name); + dialog.fields_dict.hub_category.set_data(categories); + }); return dialog; } -export { - EditDetailsDialog -}; \ No newline at end of file +export { EditDetailsDialog }; diff --git a/erpnext/public/js/hub/pages/Item.vue b/erpnext/public/js/hub/pages/Item.vue index b8399e30d6..31cc8d5c8c 100644 --- a/erpnext/public/js/hub/pages/Item.vue +++ b/erpnext/public/js/hub/pages/Item.vue @@ -311,7 +311,9 @@ export default { } ) .then((r) => { - this.get_item_details(); + return this.get_item_details(); + }) + .then(() => { frappe.show_alert(__(`${this.item.item_name} Updated`)); }) },