From 22cec21c6f9e6edff8d08882584e1fa1338572c6 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 22 Mar 2024 16:11:05 +0530 Subject: [PATCH 1/2] refactor: reset flag for old records (cherry picked from commit a88bf8419e7c9987d81b7d0c1d05f45be26d65cc) --- erpnext/patches.txt | 2 +- erpnext/patches/v14_0/update_flag_for_return_invoices.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index e67dad0e8ba3..57f49ef7754e 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -355,7 +355,7 @@ execute:frappe.db.set_single_value("Buying Settings", "project_update_frequency" erpnext.patches.v14_0.clear_reconciliation_values_from_singles erpnext.patches.v14_0.update_total_asset_cost_field erpnext.patches.v14_0.create_accounting_dimensions_in_reconciliation_tool -erpnext.patches.v14_0.update_flag_for_return_invoices +erpnext.patches.v14_0.update_flag_for_return_invoices #2024-03-22 # below migration patch should always run last erpnext.patches.v14_0.migrate_gl_to_payment_ledger erpnext.stock.doctype.delivery_note.patches.drop_unused_return_against_index # 2023-12-20 diff --git a/erpnext/patches/v14_0/update_flag_for_return_invoices.py b/erpnext/patches/v14_0/update_flag_for_return_invoices.py index feb43beacf8c..bea99575425b 100644 --- a/erpnext/patches/v14_0/update_flag_for_return_invoices.py +++ b/erpnext/patches/v14_0/update_flag_for_return_invoices.py @@ -12,6 +12,10 @@ def execute(): creation_date = "2024-01-25" si = qb.DocType("Sales Invoice") + + # unset flag, as migration would have set it for all records, as the field was introduced with default '1' + qb.update(si).set(si.update_outstanding_for_self, False).run() + if cr_notes := ( qb.from_(si) .select(si.name) @@ -37,6 +41,10 @@ def execute(): ).run() pi = qb.DocType("Purchase Invoice") + + # unset flag, as migration would have set it for all records, as the field was introduced with default '1' + qb.update(pi).set(pi.update_outstanding_for_self, False).run() + if dr_notes := ( qb.from_(pi) .select(pi.name) From dbb4391f1e4c964bd8b2b74e10fba1a7b3110b87 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Fri, 22 Mar 2024 17:50:51 +0530 Subject: [PATCH 2/2] refactor: hide on print formats (cherry picked from commit fdcdc8a56ea8892f197dd2a45b175d20137953f6) --- erpnext/accounts/doctype/sales_invoice/sales_invoice.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index ddb82d95f9de..25f11b65e492 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -2170,7 +2170,8 @@ "fieldname": "update_outstanding_for_self", "fieldtype": "Check", "label": "Update Outstanding for Self", - "no_copy": 1 + "no_copy": 1, + "print_hide": 1 } ], "icon": "fa fa-file-text", @@ -2183,7 +2184,7 @@ "link_fieldname": "consolidated_invoice" } ], - "modified": "2024-03-20 16:02:52.237732", + "modified": "2024-03-22 17:50:34.395602", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice",