fixed #1454
diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js
index 7beeb42..6ff222d 100644
--- a/erpnext/selling/page/sales_browser/sales_browser.js
+++ b/erpnext/selling/page/sales_browser/sales_browser.js
@@ -144,9 +144,14 @@
return frappe.call({
method: 'erpnext.selling.page.sales_browser.sales_browser.add_node',
args: v,
- callback: function() {
- d.hide();
- node.reload();
+ callback: function(r) {
+ if(!r.exc) {
+ d.hide();
+ node.reload();
+ if(!node.expanded) {
+ node.toggle_node();
+ }
+ }
}
})
});
diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py
index 7211a89..28d8211 100644
--- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py
+++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py
@@ -81,7 +81,7 @@
"event_type": "Private",
"ref_type": self.doc.doctype,
"ref_name": self.doc.name
- }).insert()
+ }).insert(ignore_permissions=1)
frappe.db.set(self.doc, 'status', 'Submitted')