Merge branch 'develop' into disable_update_notification
This commit is contained in:
commit
ae420cc7e1
2 changed files with 10 additions and 13 deletions
|
|
@ -42,16 +42,13 @@ def flush_old_route_records():
|
|||
|
||||
@frappe.whitelist()
|
||||
def deferred_insert(routes):
|
||||
routes_record = []
|
||||
|
||||
if isinstance(routes, str):
|
||||
routes = json.loads(routes)
|
||||
|
||||
for route_doc in routes:
|
||||
routes_record.append({
|
||||
routes = [
|
||||
{
|
||||
"user": frappe.session.user,
|
||||
"route": route_doc.get("route"),
|
||||
"creation": route_doc.get("creation")
|
||||
})
|
||||
"route": route.get("route"),
|
||||
"creation": route.get("creation"),
|
||||
}
|
||||
for route in frappe.parse_json(routes)
|
||||
]
|
||||
|
||||
_deferred_insert("Route History", json.dumps(routes_record))
|
||||
_deferred_insert("Route History", json.dumps(routes))
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ const routes_to_skip = ['Form', 'social', 'setup-wizard', 'recorder'];
|
|||
const save_routes = frappe.utils.debounce(() => {
|
||||
if (frappe.session.user === 'Guest') return;
|
||||
const routes = frappe.route_history_queue;
|
||||
frappe.route_history_queue = [];
|
||||
|
||||
if (!routes.length) return;
|
||||
|
||||
frappe.route_history_queue = [];
|
||||
|
||||
frappe.xcall('frappe.desk.doctype.route_history.route_history.deferred_insert', {
|
||||
'routes': routes
|
||||
}).catch(() => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue