hi
using tryton 5.4.3 i’m struggeling a bit with the filtering in the webclient (sao).
lets say, i’m in the view “product variants” and want to look up all variants containing the words “ford” and “302” (not necessarily in that order) in their “code”-field
so i type “ford 302” (without the quotes!) into the filter-inputbox and hit enter
the request url looks like
.../model/product.product;name="Variants"&search_value=[["rec_name","ilike","%ford%"],["rec_name","ilike","%302%"]]
i would now expect the execution of a sql statement that looks something like this:
SELECT * FROM product_product WHERE code ilike '%ford%' AND code ilike '%302%';
but what was actually executed is a statement like the following:
SELECT * FROM product_product WHERE code ilike 'ford%' AND code ilike '302%';
a condition that (as far as i understand regular expressions in postgresql) is never met.
what get i wrong here?
thanx
SELECT
"a"."id" AS "id",
"a"."active" AS "active",
"a"."code" AS "code",
"a"."create_date" AS "create_date",
"a"."create_uid" AS "create_uid",
"a"."mig_ag_nummer" AS "mig_ag_nummer",
"a"."mig_ar_nummer" AS "mig_ar_nummer",
"a"."mig_wg_nummer" AS "mig_wg_nummer",
"a"."template" AS "template",
"a"."write_date" AS "write_date",
"a"."write_uid" AS "write_uid",
CAST(EXTRACT('EPOCH'
FROM
COALESCE("a"."write_date", "a"."create_date")) AS VARCHAR) AS "_timestamp"
FROM
"product_product" AS "a"
LEFT JOIN "product_template" AS "b" ON
("b"."id" = "a"."template")
WHERE
((("a"."code" ILIKE 'ford%')
OR ("a"."id" IN (
SELECT
"c"."product"
FROM
"product_identifier" AS "c"
WHERE
(("c"."code" ILIKE 'ford%'))))
OR (("b"."id" IN (
SELECT
"d"."id"
FROM
"product_template" AS "d"
LEFT JOIN "ir_translation" AS "e" ON
((((("e"."res_id" = "d"."id")
AND ("e"."name" = 'product.template,name'))
AND ("e"."lang" = 'en'))
AND ("e"."type" = 'model'))
AND ("e"."fuzzy" = FALSE))
WHERE
(COALESCE(NULLIF(COALESCE(NULLIF(NULL,
''),
"e"."value"),
''),
"d"."name") ILIKE '%ford%')))
AND ("b"."active" IN (TRUE,
FALSE))))
AND (("a"."code" ILIKE '302%')
OR ("a"."id" IN (
SELECT
"f"."product"
FROM
"product_identifier" AS "f"
WHERE
(("f"."code" ILIKE '302%'))))
OR (("b"."id" IN (
SELECT
"g"."id"
FROM
"product_template" AS "g"
LEFT JOIN "ir_translation" AS "h" ON
((((("h"."res_id" = "g"."id")
AND ("h"."name" = 'product.template,name'))
AND ("h"."lang" = 'en'))
AND ("h"."type" = 'model'))
AND ("h"."fuzzy" = FALSE))
WHERE
(COALESCE(NULLIF(COALESCE(NULLIF(NULL,
''),
"h"."value"),
''),
"g"."name") ILIKE '%302%')))
AND ("b"."active" IN (TRUE,
FALSE))))
AND ("a"."active" = TRUE))
ORDER BY
"a"."id" ASC
LIMIT 1000