From 163af91c377bfd2398b892e7e3abd9033e401f49 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 1 Jan 2025 13:49:49 +0530 Subject: [PATCH] fix: Removed patch as instructed by mentor (cherry picked from commit d1d01482dfb006a956e010f0e27b322632072804) # Conflicts: # erpnext/patches.txt --- erpnext/patches.txt | 4 +++ .../patches/set_sc_conversion_factor.py | 26 ------------------- 2 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 erpnext/subcontracting/doctype/subcontracting_order/patches/set_sc_conversion_factor.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 075a1f4b8a7..d712933a898 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -387,7 +387,11 @@ erpnext.patches.v15_0.set_is_exchange_gain_loss_in_payment_entry_deductions erpnext.patches.v15_0.enable_allow_existing_serial_no erpnext.patches.v15_0.update_cc_in_process_statement_of_accounts <<<<<<< HEAD +<<<<<<< HEAD ======= erpnext.patches.v15_0.refactor_closing_stock_balance #5 erpnext.subcontracting.doctype.subcontracting_order.patches.set_sc_conversion_factor >>>>>>> 65dc3505c4 (fix: Added patch and fallback code to prevent future issues similiar to helpdesk ticket 28246) +======= +erpnext.patches.v15_0.refactor_closing_stock_balance #5 +>>>>>>> d1d01482df (fix: Removed patch as instructed by mentor) diff --git a/erpnext/subcontracting/doctype/subcontracting_order/patches/set_sc_conversion_factor.py b/erpnext/subcontracting/doctype/subcontracting_order/patches/set_sc_conversion_factor.py deleted file mode 100644 index 1b23c9565bf..00000000000 --- a/erpnext/subcontracting/doctype/subcontracting_order/patches/set_sc_conversion_factor.py +++ /dev/null @@ -1,26 +0,0 @@ -import frappe - - -def execute(): - # Calculate and set sc_conversion_factor for draft Subcontracting Orders if value is 0 - - subcontracting_order_items = frappe.get_all( - "Subcontracting Order Item", - filters={"docstatus": 0, "sc_conversion_factor": 0}, - fields=["name", "parent", "purchase_order_item", "qty"], - ) - for subcontracting_order_item in subcontracting_order_items: - service_item_qty = frappe.get_value( - "Subcontracting Order Service Item", - filters={ - "purchase_order_item": subcontracting_order_item.purchase_order_item, - "parent": subcontracting_order_item.parent, - }, - fieldname=["qty"], - ) - frappe.set_value( - "Subcontracting Order Item", - subcontracting_order_item.name, - "sc_conversion_factor", - service_item_qty / subcontracting_order_item.qty, - )