diff --git a/frappe/core/doctype/transaction_log/readme.md b/frappe/core/doctype/transaction_log/readme.md new file mode 100644 index 0000000000..09162ef4f0 --- /dev/null +++ b/frappe/core/doctype/transaction_log/readme.md @@ -0,0 +1,16 @@ +# Transaction Log Changelog + +## v1.0.0 +Initial version + +The line hash summarizes: +- The index of the row +- The timestamp +- The document raw data + +The chain hash summarizes: +- The previous line hash +- The current line hash + +## v1.0.1 +Modification of the timestamp fieldtype from "Time" to "Datetime" \ No newline at end of file diff --git a/frappe/core/doctype/transaction_log/transaction_log.json b/frappe/core/doctype/transaction_log/transaction_log.json index 55aa73b781..aa4ab4d473 100644 --- a/frappe/core/doctype/transaction_log/transaction_log.json +++ b/frappe/core/doctype/transaction_log/transaction_log.json @@ -1,5 +1,6 @@ { "allow_copy": 0, + "allow_events_in_timeline": 0, "allow_guest_to_view": 0, "allow_import": 0, "allow_rename": 0, @@ -178,7 +179,7 @@ "collapsible": 0, "columns": 0, "fieldname": "timestamp", - "fieldtype": "Time", + "fieldtype": "Datetime", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -436,7 +437,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-09-21 08:49:07.915376", + "modified": "2018-12-27 15:22:34.533766", "modified_by": "Administrator", "module": "Core", "name": "Transaction Log", diff --git a/frappe/core/doctype/transaction_log/transaction_log.py b/frappe/core/doctype/transaction_log/transaction_log.py index 4a3d186c6d..cab285d052 100644 --- a/frappe/core/doctype/transaction_log/transaction_log.py +++ b/frappe/core/doctype/transaction_log/transaction_log.py @@ -6,14 +6,14 @@ from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document -from frappe.utils import now, cint +from frappe.utils import cint, now_datetime import hashlib class TransactionLog(Document): def before_insert(self): index = get_current_index() self.row_index = index - self.timestamp = now() + self.timestamp = now_datetime() if index != 1: prev_hash = frappe.db.sql( "SELECT chaining_hash FROM `tabTransaction Log` WHERE row_index = {0}".format(index - 1)) @@ -25,7 +25,7 @@ class TransactionLog(Document): self.previous_hash = self.hash_line() self.transaction_hash = self.hash_line() self.chaining_hash = self.hash_chain() - self.checksum_version = "v1.0.0" + self.checksum_version = "v1.0.1" def hash_line(self): sha = hashlib.sha256() diff --git a/frappe/core/report/transaction_log_report/transaction_log_report.js b/frappe/core/report/transaction_log_report/transaction_log_report.js index 8bd37672c8..54ecf3fcf1 100644 --- a/frappe/core/report/transaction_log_report/transaction_log_report.js +++ b/frappe/core/report/transaction_log_report/transaction_log_report.js @@ -1,7 +1,11 @@ -// Copyright (c) 2016, Frappe Technologies and contributors +// Copyright (c) 2019, Frappe Technologies and contributors // For license information, please see license.txt /* eslint-disable */ frappe.query_reports["Transaction Log Report"] = { - + onload: function(query_report) { + query_report.add_make_chart_button = function() { + // + }; + } } diff --git a/frappe/core/report/transaction_log_report/transaction_log_report.json b/frappe/core/report/transaction_log_report/transaction_log_report.json index c858d51427..6d6fb78360 100644 --- a/frappe/core/report/transaction_log_report/transaction_log_report.json +++ b/frappe/core/report/transaction_log_report/transaction_log_report.json @@ -6,7 +6,7 @@ "doctype": "Report", "idx": 0, "is_standard": "Yes", - "modified": "2018-06-29 15:46:46.884862", + "modified": "2018-12-27 18:10:29.785415", "modified_by": "Administrator", "module": "Core", "name": "Transaction Log Report", @@ -18,6 +18,9 @@ "roles": [ { "role": "Administrator" + }, + { + "role": "System Manager" } ] } \ No newline at end of file diff --git a/frappe/core/report/transaction_log_report/transaction_log_report.py b/frappe/core/report/transaction_log_report/transaction_log_report.py index 2a6839d40c..9d84901f22 100644 --- a/frappe/core/report/transaction_log_report/transaction_log_report.py +++ b/frappe/core/report/transaction_log_report/transaction_log_report.py @@ -1,10 +1,11 @@ -# Copyright (c) 2013, Frappe Technologies and contributors +# Copyright (c) 2019, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import hashlib from frappe import _ +from frappe.utils import format_datetime def execute(filters=None): columns, data = get_columns(filters), get_data(filters) @@ -24,9 +25,9 @@ def get_data(filters=None): else: integrity = check_data_integrity(l.chaining_hash, l.transaction_hash, l.previous_hash, previous_hash[0][0]) - result.append([str(integrity), l.reference_doctype, l.document_name, l.owner, l.modified_by, l.timestamp]) + result.append([_(str(integrity)), _(l.reference_doctype), l.document_name, l.owner, l.modified_by, format_datetime(l.timestamp, "YYYYMMDDHHmmss")]) else: - result.append([_("First Transaction"), l.reference_doctype, l.document_name, l.owner, l.modified_by, l.timestamp]) + result.append([_("First Transaction"), _(l.reference_doctype), l.document_name, l.owner, l.modified_by, format_datetime(l.timestamp, "YYYYMMDDHHmmss")]) return result