From 67df6c60642aa4ad0fe584f844d6e4fb3b6cf9c3 Mon Sep 17 00:00:00 2001 From: Sanket322 Date: Tue, 17 Sep 2024 16:16:14 +0530 Subject: [PATCH] fix: make e-Invoice log extensible (cherry picked from commit 279d59665afe89b5499abcf7f02a22fcea6b9271) # Conflicts: # india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log.json --- .../doctype/e_invoice_log/e_invoice_log.json | 32 +++++++++++++------ india_compliance/patches.txt | 3 +- .../v14/make_e_invoice_log_extensible.py | 9 ++++++ 3 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 india_compliance/patches/v14/make_e_invoice_log_extensible.py diff --git a/india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log.json b/india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log.json index c2a8450a6..554665656 100644 --- a/india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log.json +++ b/india_compliance/gst_india/doctype/e_invoice_log/e_invoice_log.json @@ -7,7 +7,8 @@ "engine": "InnoDB", "field_order": [ "irn", - "sales_invoice", + "reference_doctype", + "reference_name", "is_generated_in_sandbox_mode", "column_break_1", "acknowledgement_number", @@ -73,13 +74,6 @@ "label": "Is Cancelled", "read_only": 1 }, - { - "fieldname": "sales_invoice", - "fieldtype": "Link", - "label": "Sales Invoice", - "options": "Sales Invoice", - "read_only": 1 - }, { "fieldname": "column_break_1", "fieldtype": "Column Break" @@ -120,6 +114,22 @@ "fieldname": "is_generated_in_sandbox_mode", "fieldtype": "Check", "label": "Is Generated in Sandbox Mode" + }, + { + "fieldname": "reference_doctype", + "fieldtype": "Link", + "in_standard_filter": 1, + "label": "Reference Document Type", + "options": "DocType", + "read_only": 1 + }, + { + "fieldname": "reference_name", + "fieldtype": "Dynamic Link", + "in_standard_filter": 1, + "label": "Reference Document Name", + "options": "reference_doctype", + "read_only": 1 } ], "in_create": 1, @@ -129,7 +139,11 @@ "link_fieldname": "irn" } ], +<<<<<<< HEAD "modified": "2023-07-27 15:04:26.931722", +======= + "modified": "2024-09-17 15:15:35.720311", +>>>>>>> 279d5966 (fix: make e-Invoice log extensible) "modified_by": "Administrator", "module": "GST India", "name": "e-Invoice Log", @@ -160,5 +174,5 @@ "sort_field": "modified", "sort_order": "DESC", "states": [], - "title_field": "sales_invoice" + "title_field": "reference_name" } \ No newline at end of file diff --git a/india_compliance/patches.txt b/india_compliance/patches.txt index fdc400132..dcd349706 100644 --- a/india_compliance/patches.txt +++ b/india_compliance/patches.txt @@ -62,4 +62,5 @@ india_compliance.patches.v14.enable_sales_through_ecommerce_operator execute:from india_compliance.gst_india.setup import set_default_print_settings; set_default_print_settings() india_compliance.patches.v15.migrate_gstr1_log_to_returns_log india_compliance.patches.v15.update_action_for_gst_inward_supply -india_compliance.patches.v15.set_default_for_new_gst_category_notification \ No newline at end of file +india_compliance.patches.v15.set_default_for_new_gst_category_notification +india_compliance.patches.v14.make_e_invoice_log_extensible \ No newline at end of file diff --git a/india_compliance/patches/v14/make_e_invoice_log_extensible.py b/india_compliance/patches/v14/make_e_invoice_log_extensible.py new file mode 100644 index 000000000..cfe42dd0f --- /dev/null +++ b/india_compliance/patches/v14/make_e_invoice_log_extensible.py @@ -0,0 +1,9 @@ +import frappe + + +def execute(): + e_invoice_log = frappe.qb.DocType("e-Invoice Log") + + frappe.qb.update(e_invoice_log).set( + e_invoice_log.reference_name, e_invoice_log.sales_invoice + ).set(e_invoice_log.reference_doctype, "Sales Invoice").run()