mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-14 23:18:40 +00:00
fix(selling): compare the selling Check field with 1, not a Python bool (Postgres)
Customer-wise Item Price builds `ip.selling.eq(True)`, which renders
`WHERE "selling" = true`. `selling` is a Check field (smallint on Postgres),
and PostgreSQL has no `smallint = boolean` operator:
operator does not exist: smallint = boolean
MariaDB accepts it because `true` aliases to `1`. Comparing with the integer
`1` (`ip.selling.eq(1)`) selects identical rows on MariaDB and is valid on
PostgreSQL.
This commit is contained in:
@@ -62,7 +62,7 @@ def fetch_item_prices(
|
||||
or_conditions = []
|
||||
if items:
|
||||
and_conditions.append(ip.item_code.isin([x.item_code for x in items]))
|
||||
and_conditions.append(ip.selling.eq(True))
|
||||
and_conditions.append(ip.selling.eq(1))
|
||||
|
||||
or_conditions.append(ip.customer.isnull())
|
||||
or_conditions.append(ip.price_list.isnull())
|
||||
|
||||
Reference in New Issue
Block a user