mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-15 07:28:39 +00:00
fix(controllers): cast overproduced-qty flag to bool in subcontracting Case
The max-allowed-qty Case used `... | ValueWrapper(allow_delivery_of_overproduced_qty)`
where the flag is an int (0/1). Postgres rejects `OR <integer>` ("argument of
OR must be type boolean"). Wrap it in bool() so the literal renders as
true/false. MariaDB behaviour is unchanged.
Surgical: only the bool() wrap is applied; develop's weighted-average rate
logic and the internal/whitelisted status-helper split are left intact (the
staging branch predated both).
Covered by test_subcontracting_inward_order.test_over_production_delivery,
which now passes on Postgres and is unchanged on MariaDB.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -509,8 +509,9 @@ class SubcontractingInwardController:
|
||||
(
|
||||
Case()
|
||||
.when(
|
||||
# bool() so the literal renders as true/false; postgres rejects `OR <integer>`
|
||||
(table.produced_qty < table.qty)
|
||||
| ValueWrapper(allow_delivery_of_overproduced_qty),
|
||||
| ValueWrapper(bool(allow_delivery_of_overproduced_qty)),
|
||||
table.produced_qty,
|
||||
)
|
||||
.else_(table.qty)
|
||||
|
||||
Reference in New Issue
Block a user