mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-23 20:16:40 +00:00
_query_bom_items / _build_base_bom_items_query / _add_*_item_columns selected non-grouped columns (idx, item_name, image, project, item-default fields, BOM Item attributes) alongside `group by item_code` -> arbitrary pick on MariaDB, GroupingError on Postgres. Wrap them in Max() (Min() for idx, preserving the original ordering). Every wrapped column is functionally dependent on the grouped item_code (item attributes / the single BOM's project / one Item Default per item+company), so Max()/Min() returns exactly the value MySQL picked arbitrarily -> MariaDB output unchanged. This was previously shipped in #56008 and reverted with that batch; re-applied in isolation here. Verified: test_work_order 85/85 on BOTH MariaDB (no change) and Postgres (was 85/85 failing on this query). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Plan and manage manufacturing operations, bill of materials for manufacturing.