Skip to content

Commit

Permalink
feat: remove transaction logs
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed May 9, 2023
1 parent afeea13 commit 2567100
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
26 changes: 0 additions & 26 deletions erpnext_germany/__init__.py
Original file line number Diff line number Diff line change
@@ -1,27 +1 @@
__version__ = "0.0.4"

import frappe
from frappe import _

from erpnext import get_region


def create_transaction_log(doc, method):
"""
Appends the transaction to a chain of hashed logs for legal resons.
Called on submit of Sales Invoice and Payment Entry.
"""
region = get_region()
if region != "Germany":
return

data = str(doc.as_dict())

frappe.get_doc(
{
"doctype": "Transaction Log",
"reference_doctype": doc.doctype,
"document_name": doc.name,
"data": data,
}
).insert(ignore_permissions=True)
5 changes: 1 addition & 4 deletions erpnext_germany/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@
# }
# }

doc_events = {
"Sales Invoice": {"on_submit": "erpnext_germany.create_transaction_log"},
"Payment Entry": {"on_submit": "erpnext_germany.create_transaction_log"},
}
# doc_events = {}

# Scheduled Tasks
# ---------------
Expand Down

0 comments on commit 2567100

Please sign in to comment.