diff --git a/ecommerce_integrations/ecommerce_integrations/doctype/ecommerce_integration_log/ecommerce_integration_log.json b/ecommerce_integrations/ecommerce_integrations/doctype/ecommerce_integration_log/ecommerce_integration_log.json index 01722a1c..f4746789 100644 --- a/ecommerce_integrations/ecommerce_integrations/doctype/ecommerce_integration_log/ecommerce_integration_log.json +++ b/ecommerce_integrations/ecommerce_integrations/doctype/ecommerce_integration_log/ecommerce_integration_log.json @@ -8,8 +8,15 @@ "title", "integration", "status", - "method", + "column_break_fhrq", + "psl", + "payment_status", + "is_retry", + "reference_doctype", + "reference_docname", + "section_break_swkt", "message", + "method", "traceback", "request_data", "response_data" @@ -66,11 +73,55 @@ "fieldtype": "Code", "label": "Response Data", "read_only": 1 + }, + { + "default": "0", + "description": "Use to exclude reties from notifications", + "fieldname": "is_retry", + "fieldtype": "Check", + "label": "Is Retry", + "read_only": 1 + }, + { + "fieldname": "payment_status", + "fieldtype": "Data", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Payment Status", + "read_only": 1 + }, + { + "fieldname": "psl", + "fieldtype": "Link", + "label": "Payment Session Log", + "options": "Payment Session Log", + "read_only": 1 + }, + { + "fieldname": "column_break_fhrq", + "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_swkt", + "fieldtype": "Section Break" + }, + { + "fieldname": "reference_doctype", + "fieldtype": "Link", + "label": "Reference Doctype", + "options": "DocType", + "read_only": 1 + }, + { + "fieldname": "reference_docname", + "fieldtype": "Dynamic Link", + "label": "Reference Docname", + "options": "reference_doctype" } ], "in_create": 1, "links": [], - "modified": "2021-05-28 16:06:49.008875", + "modified": "2024-06-23 13:51:52.650162", "modified_by": "Administrator", "module": "Ecommerce Integrations", "name": "Ecommerce Integration Log", @@ -104,4 +155,4 @@ "sort_field": "modified", "sort_order": "DESC", "title_field": "title" -} \ No newline at end of file +} diff --git a/ecommerce_integrations/ecommerce_integrations/doctype/ecommerce_integration_log/ecommerce_integration_log.py b/ecommerce_integrations/ecommerce_integrations/doctype/ecommerce_integration_log/ecommerce_integration_log.py index 4a9f6723..a89b500f 100644 --- a/ecommerce_integrations/ecommerce_integrations/doctype/ecommerce_integration_log/ecommerce_integration_log.py +++ b/ecommerce_integrations/ecommerce_integrations/doctype/ecommerce_integration_log/ecommerce_integration_log.py @@ -47,6 +47,9 @@ def create_log( method=None, message=None, make_new=False, + payment_status=None, + reference_doctype=None, + reference_docname=None, ): make_new = make_new or not bool(frappe.flags.request_id) @@ -65,6 +68,13 @@ def create_log( if request_data and not isinstance(request_data, str): request_data = json.dumps(request_data, sort_keys=True, indent=4) + if payment_status: + log.payment_status = payment_status + if reference_doctype: + log.reference_doctype = reference_doctype + if reference_docname: + log.reference_docname = reference_docname + log.message = message or _get_message(exception) log.method = log.method or method log.response_data = response_data or log.response_data diff --git a/ecommerce_integrations/hooks.py b/ecommerce_integrations/hooks.py index face21c3..6fea24dd 100644 --- a/ecommerce_integrations/hooks.py +++ b/ecommerce_integrations/hooks.py @@ -9,6 +9,8 @@ app_email = "developers@frappe.io" app_license = "GNU GPL v3.0" +required_apps = ["payments", "erpnext"] + # Includes in # ------------------ @@ -166,6 +168,10 @@ # bootinfo - hide old doctypes extend_bootinfo = "ecommerce_integrations.boot.boot_session" +ignore_links_on_delete = [ + "Ecommerce Integration Log", +] + # Testing # -------