mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-13 06:31:48 +00:00
fix: pass finished goods as list to subcontracting BOM lookup
set_service_items_for_finished_goods built a set and passed it to get_subcontracting_boms_for_finished_goods, whose filter builder only handles str and list. Whitelist type validation lax-coerces the set to a list during HTTP requests and tests, hiding the mismatch, but from console, bench execute or background contexts the set reaches frappe.get_all verbatim and is inlined into invalid SQL on both MariaDB and PostgreSQL. Ref #57996
This commit is contained in:
@@ -51,9 +51,9 @@ class SubcontractingService:
|
||||
if not doc.is_subcontracted:
|
||||
return
|
||||
|
||||
finished_goods_without_service_item = {
|
||||
d.fg_item for d in doc.items if (not d.item_code and d.fg_item)
|
||||
}
|
||||
finished_goods_without_service_item = list(
|
||||
{d.fg_item for d in doc.items if (not d.item_code and d.fg_item)}
|
||||
)
|
||||
|
||||
if subcontracting_boms := get_subcontracting_boms_for_finished_goods(
|
||||
finished_goods_without_service_item
|
||||
|
||||
Reference in New Issue
Block a user