From 0d498baa100098b2481ad664fdc543a5dddb0d4e Mon Sep 17 00:00:00 2001 From: Trusted Computer <75872475+trustedcomputer@users.noreply.github.com> Date: Tue, 28 Apr 2026 08:42:41 -0700 Subject: [PATCH] refactor: bring back titles on sales transactions and make them optional and visible on purchase transactions (backport #52633) (#54601) * refactor: bring back titles on sales transactions and make them optional and visible on purchase transactions * fix: update timestamp in json to UTC --- .../doctype/pos_invoice/pos_invoice.json | 16 +++++++++++++++- .../doctype/pos_invoice/pos_invoice.py | 1 + .../purchase_invoice/purchase_invoice.json | 16 +++++++++++++++- .../purchase_invoice/purchase_invoice.py | 1 + .../doctype/sales_invoice/sales_invoice.json | 16 +++++++++++++++- .../doctype/sales_invoice/sales_invoice.py | 1 + .../purchase_order/purchase_order.json | 16 +++++++++++++++- .../doctype/purchase_order/purchase_order.py | 1 + .../request_for_quotation.json | 19 +++++++++++++++++-- .../request_for_quotation.py | 1 + .../supplier_quotation.json | 14 +++++++++----- erpnext/patches.txt | 3 ++- erpnext/patches/v16_0/correct_po_titles.py | 15 +++++++++++++++ .../selling/doctype/quotation/quotation.json | 16 +++++++++++++++- .../selling/doctype/quotation/quotation.py | 1 + .../doctype/sales_order/sales_order.json | 16 +++++++++++++++- .../doctype/sales_order/sales_order.py | 1 + .../doctype/delivery_note/delivery_note.json | 17 +++++++++++++++-- .../doctype/delivery_note/delivery_note.py | 1 + .../purchase_receipt/purchase_receipt.json | 16 +++++++++++++++- .../purchase_receipt/purchase_receipt.py | 1 + 21 files changed, 172 insertions(+), 17 deletions(-) create mode 100644 erpnext/patches/v16_0/correct_po_titles.py diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json index c8fc266b012..248b577d57d 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.json +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.json @@ -26,6 +26,8 @@ "due_date", "amended_from", "return_against", + "section_break_abck", + "title", "accounting_dimensions_section", "project", "dimension_col_break", @@ -1620,12 +1622,24 @@ "fieldname": "auto_repeat_section", "fieldtype": "Section Break", "label": "Auto Repeat" + }, + { + "fieldname": "section_break_abck", + "fieldtype": "Section Break" + }, + { + "allow_on_submit": 1, + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "no_copy": 1, + "print_hide": 1 } ], "icon": "fa fa-file-text", "is_submittable": 1, "links": [], - "modified": "2026-03-02 07:32:47.667810", + "modified": "2026-04-28 06:06:14.283612", "modified_by": "Administrator", "module": "Accounts", "name": "POS Invoice", diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py index 503c19c7ff8..a5437409bcd 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py @@ -172,6 +172,7 @@ class POSInvoice(SalesInvoice): terms: DF.TextEditor | None territory: DF.Link | None timesheets: DF.Table[SalesInvoiceTimesheet] + title: DF.Data | None to_date: DF.Date | None total: DF.Currency total_advance: DF.Currency diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index f7f8d8b8ffc..4f8fe3a79ca 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -27,6 +27,8 @@ "update_billed_amount_in_purchase_receipt", "apply_tds", "amended_from", + "section_break_hzux", + "title", "supplier_invoice_details", "bill_no", "column_break_15", @@ -1682,6 +1684,18 @@ "fieldname": "automation_section", "fieldtype": "Section Break", "label": "Automation" + }, + { + "fieldname": "section_break_hzux", + "fieldtype": "Section Break" + }, + { + "allow_on_submit": 1, + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "no_copy": 1, + "print_hide": 1 } ], "grid_page_length": 50, @@ -1689,7 +1703,7 @@ "idx": 204, "is_submittable": 1, "links": [], - "modified": "2026-03-25 11:45:38.696888", + "modified": "2026-04-28 07:15:31.062404", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index c790f86633a..a7ef9f1414d 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -203,6 +203,7 @@ class PurchaseInvoice(BuyingController): taxes_and_charges_deducted: DF.Currency tc_name: DF.Link | None terms: DF.TextEditor | None + title: DF.Data | None to_date: DF.Date | None total: DF.Currency total_advance: DF.Currency diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 267b161bee5..9baa366c27f 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -33,6 +33,8 @@ "is_created_using_pos", "pos_closing_entry", "has_subcontracted", + "section_break_qllv", + "title", "accounting_dimensions_section", "cost_center", "dimension_col_break", @@ -2338,6 +2340,18 @@ { "fieldname": "column_break_iaso", "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_qllv", + "fieldtype": "Section Break" + }, + { + "allow_on_submit": 1, + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "no_copy": 1, + "print_hide": 1 } ], "grid_page_length": 50, @@ -2351,7 +2365,7 @@ "link_fieldname": "consolidated_invoice" } ], - "modified": "2026-04-28 12:39:53.267755", + "modified": "2026-04-28 13:08:19.849783", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 0477c172587..ef64a3ef79b 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -225,6 +225,7 @@ class SalesInvoice(SellingController): terms: DF.TextEditor | None territory: DF.Link | None timesheets: DF.Table[SalesInvoiceTimesheet] + title: DF.Data | None to_date: DF.Date | None total: DF.Currency total_advance: DF.Currency diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 6d59d0b9884..ee1f13e4b3f 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -23,6 +23,8 @@ "is_subcontracted", "has_unit_price_items", "supplier_warehouse", + "section_break_ahub", + "title", "accounting_dimensions_section", "cost_center", "dimension_col_break", @@ -1309,6 +1311,18 @@ "fieldname": "auto_repeat_section", "fieldtype": "Section Break", "label": "Auto Repeat" + }, + { + "fieldname": "section_break_ahub", + "fieldtype": "Section Break" + }, + { + "allow_on_submit": 1, + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "no_copy": 1, + "print_hide": 1 } ], "grid_page_length": 50, @@ -1316,7 +1330,7 @@ "idx": 105, "is_submittable": 1, "links": [], - "modified": "2026-03-25 11:46:18.748951", + "modified": "2026-04-28 06:11:46.904768", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 2cb285c14f3..48ed761829e 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -159,6 +159,7 @@ class PurchaseOrder(BuyingController): taxes_and_charges_deducted: DF.Currency tc_name: DF.Link | None terms: DF.TextEditor | None + title: DF.Data | None to_date: DF.Date | None total: DF.Currency total_net_weight: DF.Float diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json index de8b4d28547..988ffcb9eb3 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.json @@ -16,6 +16,8 @@ "status", "has_unit_price_items", "amended_from", + "section_break_mhyw", + "title", "suppliers_section", "suppliers", "items_section", @@ -371,6 +373,18 @@ "fieldtype": "Text Editor", "label": "Shipping Address Details", "read_only": 1 + }, + { + "fieldname": "section_break_mhyw", + "fieldtype": "Section Break" + }, + { + "allow_on_submit": 1, + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "no_copy": 1, + "print_hide": 1 } ], "grid_page_length": 50, @@ -378,7 +392,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2026-03-19 15:27:56.730649", + "modified": "2026-04-28 06:18:05.661710", "modified_by": "Administrator", "module": "Buying", "name": "Request for Quotation", @@ -448,5 +462,6 @@ "show_name_in_global_search": 1, "sort_field": "creation", "sort_order": "DESC", - "states": [] + "states": [], + "title_field": "company" } diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py index 03254c30f6e..c99d0f00606 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py @@ -63,6 +63,7 @@ class RequestforQuotation(BuyingController): suppliers: DF.Table[RequestforQuotationSupplier] tc_name: DF.Link | None terms: DF.TextEditor | None + title: DF.Data | None transaction_date: DF.Date use_html: DF.Check vendor: DF.Link | None diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index bb1c048301e..ec0b33611b3 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -9,7 +9,6 @@ "engine": "InnoDB", "field_order": [ "supplier_section", - "title", "naming_series", "supplier", "supplier_name", @@ -21,6 +20,8 @@ "quotation_number", "has_unit_price_items", "amended_from", + "section_break_kumc", + "title", "accounting_dimensions_section", "cost_center", "dimension_col_break", @@ -127,10 +128,9 @@ "options": "fa fa-user" }, { - "default": "{supplier_name}", + "allow_on_submit": 1, "fieldname": "title", "fieldtype": "Data", - "hidden": 1, "label": "Title", "no_copy": 1, "print_hide": 1, @@ -940,6 +940,10 @@ "fieldname": "auto_repeat_section", "fieldtype": "Section Break", "label": "Auto Repeat" + }, + { + "fieldname": "section_break_kumc", + "fieldtype": "Section Break" } ], "grid_page_length": 50, @@ -948,7 +952,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2026-02-27 18:05:50.121391", + "modified": "2026-04-28 06:23:52.813948", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", @@ -1016,5 +1020,5 @@ "sort_order": "DESC", "states": [], "timeline_field": "supplier", - "title_field": "title" + "title_field": "supplier_name" } diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 1eb86cef190..f9fd4a5cb66 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -478,4 +478,5 @@ erpnext.patches.v16_0.uom_category erpnext.patches.v16_0.merge_repost_settings_to_accounts_settings erpnext.patches.v16_0.set_root_type_in_account_categories erpnext.patches.v16_0.scr_inv_dimension -erpnext.patches.v16_0.packed_item_inv_dimen \ No newline at end of file +erpnext.patches.v16_0.packed_item_inv_dimen +erpnext.patches.v16_0.correct_po_titles \ No newline at end of file diff --git a/erpnext/patches/v16_0/correct_po_titles.py b/erpnext/patches/v16_0/correct_po_titles.py new file mode 100644 index 00000000000..04334e52ca7 --- /dev/null +++ b/erpnext/patches/v16_0/correct_po_titles.py @@ -0,0 +1,15 @@ +import frappe + + +def execute(): + """ + This patch corrects the titles of purchase orders that were set to + the text string "{supplier_name}" instead of the actual supplier name. + """ + + purchase_order = frappe.qb.DocType("Purchase Order") + ( + frappe.qb.update(purchase_order) + .set(purchase_order.title, purchase_order.supplier_name) + .where(purchase_order.title == "{supplier_name}") + ).run() diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index 71d977638e8..c22bd3b3e68 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -22,6 +22,8 @@ "company", "has_unit_price_items", "amended_from", + "section_break_jdzz", + "title", "currency_and_price_list", "currency", "conversion_rate", @@ -1122,13 +1124,25 @@ "fieldname": "auto_repeat_section", "fieldtype": "Section Break", "label": "Auto Repeat" + }, + { + "fieldname": "section_break_jdzz", + "fieldtype": "Section Break" + }, + { + "allow_on_submit": 1, + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "no_copy": 1, + "print_hide": 1 } ], "icon": "fa fa-shopping-cart", "idx": 82, "is_submittable": 1, "links": [], - "modified": "2026-03-09 17:15:31.941114", + "modified": "2026-04-28 06:28:13.103302", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 3eb82af1b01..dcdf4adcd35 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -112,6 +112,7 @@ class Quotation(SellingController): tc_name: DF.Link | None terms: DF.TextEditor | None territory: DF.Link | None + title: DF.Data | None total: DF.Currency total_net_weight: DF.Float total_qty: DF.Float diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json index 3109fd0e36e..a8506dfb03f 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.json +++ b/erpnext/selling/doctype/sales_order/sales_order.json @@ -26,6 +26,8 @@ "has_unit_price_items", "is_subcontracted", "amended_from", + "section_break_zstt", + "title", "accounting_dimensions_section", "cost_center", "dimension_col_break", @@ -1742,6 +1744,18 @@ "no_copy": 1, "print_hide": 1, "read_only": 1 + }, + { + "fieldname": "section_break_zstt", + "fieldtype": "Section Break" + }, + { + "allow_on_submit": 1, + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "no_copy": 1, + "print_hide": 1 } ], "grid_page_length": 50, @@ -1749,7 +1763,7 @@ "idx": 105, "is_submittable": 1, "links": [], - "modified": "2026-03-04 18:04:05.873483", + "modified": "2026-04-28 06:30:35.902868", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order", diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 619f5cfcf19..e63ac802e35 100755 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -181,6 +181,7 @@ class SalesOrder(SellingController): tc_name: DF.Link | None terms: DF.TextEditor | None territory: DF.Link | None + title: DF.Data | None to_date: DF.Date | None total: DF.Currency total_commission: DF.Currency diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json index e8871227c60..0b620fd189c 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.json +++ b/erpnext/stock/doctype/delivery_note/delivery_note.json @@ -22,6 +22,8 @@ "is_return", "issue_credit_note", "return_against", + "section_break_zxcd", + "title", "accounting_dimensions_section", "cost_center", "column_break_18", @@ -76,7 +78,6 @@ "base_totals_section", "base_grand_total", "base_in_words", - "column_break_ydwe", "base_rounding_adjustment", "base_rounded_total", "section_break_49", @@ -1446,13 +1447,25 @@ "fieldname": "auto_repeat_section", "fieldtype": "Section Break", "label": "Auto Repeat" + }, + { + "fieldname": "section_break_zxcd", + "fieldtype": "Section Break" + }, + { + "allow_on_submit": 1, + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "no_copy": 1, + "print_hide": 1 } ], "icon": "fa fa-truck", "idx": 146, "is_submittable": 1, "links": [], - "modified": "2026-03-09 17:15:27.932956", + "modified": "2026-04-28 06:37:33.600775", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note", diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index e0154bf13cc..f0e44ed368d 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -145,6 +145,7 @@ class DeliveryNote(SellingController): tc_name: DF.Link | None terms: DF.TextEditor | None territory: DF.Link | None + title: DF.Data | None total: DF.Currency total_commission: DF.Currency total_net_weight: DF.Float diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json index 82745b34bbf..5238eca245a 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json @@ -25,6 +25,8 @@ "apply_putaway_rule", "is_return", "return_against", + "section_break_yxar", + "title", "accounting_dimensions_section", "cost_center", "dimension_col_break", @@ -1285,6 +1287,18 @@ { "fieldname": "column_break_ugyv", "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_yxar", + "fieldtype": "Section Break" + }, + { + "allow_on_submit": 1, + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "no_copy": 1, + "print_hide": 1 } ], "grid_page_length": 50, @@ -1292,7 +1306,7 @@ "idx": 261, "is_submittable": 1, "links": [], - "modified": "2026-04-06 14:11:29.630333", + "modified": "2026-04-28 06:47:12.170270", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt", diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index ac738fe66d8..d28cce17c00 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -148,6 +148,7 @@ class PurchaseReceipt(BuyingController): taxes_and_charges_deducted: DF.Currency tc_name: DF.Link | None terms: DF.TextEditor | None + title: DF.Data | None total: DF.Currency total_net_weight: DF.Float total_qty: DF.Float