From 4fd1af21184483cd274aa70bd176fd244e748f44 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 15:55:40 +0530 Subject: [PATCH] fix: patch to set status cancelled for already cancelled pos invoices (backport #47725) (#47759) * fix: patch to set status cancelled for already cancelled pos invoices (#47725) (cherry picked from commit 4d1d66e579c795e4732d7c88621350780966ae29) # Conflicts: # erpnext/patches.txt * chore: resolve conflict --------- Co-authored-by: Diptanil Saha --- erpnext/patches.txt | 1 + .../set_cancelled_status_to_cancelled_pos_invoice.py | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 erpnext/patches/v15_0/set_cancelled_status_to_cancelled_pos_invoice.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 8bd4e847c22..d78e86bd1d7 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -404,5 +404,6 @@ erpnext.patches.v15_0.update_payment_schedule_fields_in_invoices erpnext.patches.v15_0.rename_group_by_to_categorize_by execute:frappe.db.set_single_value("Accounts Settings", "receivable_payable_fetch_method", "Buffered Cursor") erpnext.patches.v14_0.set_update_price_list_based_on +erpnext.patches.v15_0.set_cancelled_status_to_cancelled_pos_invoice erpnext.patches.v15_0.rename_group_by_to_categorize_by_in_custom_reports erpnext.patches.v14_0.update_full_name_in_contract diff --git a/erpnext/patches/v15_0/set_cancelled_status_to_cancelled_pos_invoice.py b/erpnext/patches/v15_0/set_cancelled_status_to_cancelled_pos_invoice.py new file mode 100644 index 00000000000..a4141ec20e6 --- /dev/null +++ b/erpnext/patches/v15_0/set_cancelled_status_to_cancelled_pos_invoice.py @@ -0,0 +1,8 @@ +import frappe +from frappe.query_builder import DocType + + +def execute(): + POSInvoice = DocType("POS Invoice") + + frappe.qb.update(POSInvoice).set(POSInvoice.status, "Cancelled").where(POSInvoice.docstatus == 2).run()