mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-04 19:14:41 +00:00
fix: Removed patch as instructed by mentor
This commit is contained in:
@@ -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,
|
||||
)
|
||||
Reference in New Issue
Block a user