Charles-Henri Decultot | b8c088e | 2018-02-21 06:37:33 +0100 | [diff] [blame] | 1 | # Copyright (c) 2018, Frappe Technologies and contributors |
| 2 | # For license information, please see license.txt |
| 3 | |
| 4 | import frappe |
| 5 | from frappe import _ |
| 6 | from erpnext import get_region |
| 7 | |
| 8 | def create_transaction_log(doc, method): |
| 9 | region = get_region() |
| 10 | if region not in ["France"]: |
| 11 | return |
Charles-Henri Decultot | b8c088e | 2018-02-21 06:37:33 +0100 | [diff] [blame] | 12 | else: |
Charles-Henri Decultot | b8c088e | 2018-02-21 06:37:33 +0100 | [diff] [blame] | 13 | data = str(doc.as_dict()) |
| 14 | |
| 15 | frappe.get_doc({ |
| 16 | "doctype": "Transaction Log", |
| 17 | "reference_doctype": doc.doctype, |
| 18 | "document_name": doc.name, |
| 19 | "data": data |
| 20 | }).insert(ignore_permissions=True) |
| 21 | |
Charles-Henri Decultot | b8c088e | 2018-02-21 06:37:33 +0100 | [diff] [blame] | 22 | # don't remove this function it is used in tests |
| 23 | def test_method(): |
| 24 | '''test function''' |
| 25 | return 'overridden' |