On 2015-07-07 20:04, Jordi Esteve wrote:
> In sale and purchase modules the functional sales and purchases fields are
> defined on invoice model with a searcher method.
> 
> If these fields are added in the invoice tree view and we search the
> invoices related to the SO001 sale, for example, I get this error SQL error
> because the sales id is compared with a string:
> 
> ProgrammingError: operator does not exist: integer ~~* unknown
> LINE 1: ..."e" ON ("e"."id" = "d"."sale") WHERE (((("e"."id" ILIKE '%SO001
> ...
>                                                              ^
> HINT:  No operator matches the given name and argument type(s). You might
> need to add explicit type casts.
> 
> 
> The problem is the last .id in the domain of the searcher method. Removing
> '.id' the search works well:
> 
>     def search_sales(cls, name, clause):
>         return [('lines.origin.sale*.id*',) + tuple(clause[1:]) +
> ('sale.line',)]
> 
> Tested in v3.4 but I think v3.6 and trunk have the same behaviour.

Won't fix. You should consider it as the behaviour of this function
field.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Reply via email to