mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
feat(regional): enable transaction log for germany (#19198)
This commit is contained in:
committed by
Nabin Hait
parent
a5776d16b4
commit
edba06038e
@@ -10,3 +10,21 @@ def check_deletion_permission(doc, method):
|
||||
region = get_region(doc.company)
|
||||
if region in ["Nepal", "France"] and doc.docstatus != 0:
|
||||
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.
|
||||
"""
|
||||
region = get_region()
|
||||
if region not in ["France", "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