mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
fix: stop creating transaction logs (#49383)
This commit is contained in:
@@ -357,7 +357,6 @@ doc_events = {
|
|||||||
},
|
},
|
||||||
"Sales Invoice": {
|
"Sales Invoice": {
|
||||||
"on_submit": [
|
"on_submit": [
|
||||||
"erpnext.regional.create_transaction_log",
|
|
||||||
"erpnext.regional.italy.utils.sales_invoice_on_submit",
|
"erpnext.regional.italy.utils.sales_invoice_on_submit",
|
||||||
],
|
],
|
||||||
"on_cancel": [
|
"on_cancel": [
|
||||||
@@ -372,9 +371,6 @@ doc_events = {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"Payment Entry": {
|
"Payment Entry": {
|
||||||
"on_submit": [
|
|
||||||
"erpnext.regional.create_transaction_log",
|
|
||||||
],
|
|
||||||
"on_trash": "erpnext.regional.check_deletion_permission",
|
"on_trash": "erpnext.regional.check_deletion_permission",
|
||||||
},
|
},
|
||||||
"Address": {
|
"Address": {
|
||||||
|
|||||||
@@ -12,27 +12,3 @@ def check_deletion_permission(doc, method):
|
|||||||
region = get_region(doc.company)
|
region = get_region(doc.company)
|
||||||
if region in ["Nepal"] and doc.docstatus != 0:
|
if region in ["Nepal"] and doc.docstatus != 0:
|
||||||
frappe.throw(_("Deletion is not permitted for country {0}").format(region))
|
frappe.throw(_("Deletion is not permitted for country {0}").format(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.
|
|
||||||
"""
|
|
||||||
if frappe.conf.get("disable_transaction_log", False):
|
|
||||||
return
|
|
||||||
|
|
||||||
region = get_region()
|
|
||||||
if region not in ["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)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user