fix: show event configurations in event sync log
This commit is contained in:
parent
29280aa8e3
commit
fe72cae360
2 changed files with 38 additions and 4 deletions
|
|
@ -111,6 +111,7 @@ def pull_from_node(event_producer):
|
|||
mapping = mapping_config.get(update.ref_doctype)
|
||||
if mapping:
|
||||
update = get_mapped_update(mapping, update)
|
||||
update.mapping = mapping
|
||||
if not update.update_type == 'Delete':
|
||||
update.data = json.loads(update.data)
|
||||
|
||||
|
|
@ -257,12 +258,18 @@ def log_event_sync(update, event_producer, sync_status, error=None):
|
|||
doc = frappe.new_doc('Event Sync Log')
|
||||
doc.update_type = update.update_type
|
||||
doc.ref_doctype = update.ref_doctype
|
||||
doc.docname = update.docname
|
||||
doc.status = sync_status
|
||||
doc.event_producer = event_producer
|
||||
doc.producer_doc = update.docname
|
||||
doc.data = frappe.as_json(update.data)
|
||||
if error:
|
||||
doc.use_same_name = 'Yes' if update.use_same_name else 'No'
|
||||
doc.mapping = update.mapping if update.mapping else None
|
||||
if sync_status == 'Synced':
|
||||
if update.use_same_name:
|
||||
doc.docname = update.docname
|
||||
else:
|
||||
doc.docname = frappe.db.get_value(update.ref_doctype, {'remote_docname': update.docname}, 'name')
|
||||
else:
|
||||
doc.error = error
|
||||
doc.insert()
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@
|
|||
"status",
|
||||
"event_producer",
|
||||
"producer_doc",
|
||||
"event_configurations_section",
|
||||
"use_same_name",
|
||||
"column_break_9",
|
||||
"mapping",
|
||||
"section_break_8",
|
||||
"data",
|
||||
"error"
|
||||
|
|
@ -61,7 +65,8 @@
|
|||
},
|
||||
{
|
||||
"fieldname": "section_break_8",
|
||||
"fieldtype": "Section Break"
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Data"
|
||||
},
|
||||
{
|
||||
"fieldname": "data",
|
||||
|
|
@ -81,10 +86,32 @@
|
|||
"fieldtype": "Code",
|
||||
"label": "Error",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "event_configurations_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Event Configurations"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "use_same_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Use Same Name",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_9",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "mapping",
|
||||
"fieldtype": "Data",
|
||||
"label": "Mapping",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"in_create": 1,
|
||||
"modified": "2019-10-03 21:29:43.036851",
|
||||
"modified": "2019-10-07 13:22:10.401479",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Events Streaming",
|
||||
"name": "Event Sync Log",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue