mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-27 13:55:19 +00:00
refactor(subcontracting): hoist ValueWrapper import to module level
`validate_delivery_on_save` imported `pypika.terms.ValueWrapper` inside its per-item loop, re-running the import on every iteration. Move it to the module-level imports.
This commit is contained in:
@@ -4,6 +4,7 @@ import frappe
|
|||||||
from frappe import _, bold
|
from frappe import _, bold
|
||||||
from frappe.query_builder import Case
|
from frappe.query_builder import Case
|
||||||
from frappe.utils import flt, get_link_to_form
|
from frappe.utils import flt, get_link_to_form
|
||||||
|
from pypika.terms import ValueWrapper
|
||||||
|
|
||||||
from erpnext.stock.serial_batch_bundle import get_serial_batch_list_from_item
|
from erpnext.stock.serial_batch_bundle import get_serial_batch_list_from_item
|
||||||
|
|
||||||
@@ -500,8 +501,6 @@ class SubcontractingInwardController:
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
from pypika.terms import ValueWrapper
|
|
||||||
|
|
||||||
table = frappe.qb.DocType("Subcontracting Inward Order Item")
|
table = frappe.qb.DocType("Subcontracting Inward Order Item")
|
||||||
query = (
|
query = (
|
||||||
frappe.qb.from_(table)
|
frappe.qb.from_(table)
|
||||||
|
|||||||
Reference in New Issue
Block a user