On 23 Mar 01:07, Pascal Obstetar wrote:
> 
> 
> Le samedi 22 mars 2014 23:21:02 UTC+1, Jean C a écrit :
> >
> > domain=[('matériel', '=', Eval('matériel'))]
> >
> 
> Déjà essayé mais j'obtiens cette erreur :
> 
> Traceback (most recent call last):
>   File "/trytond/protocols/jsonrpc.py", line 210, in _marshaled_dispatch
>     response['result'] = dispatch_method(method, params)
>   File "/trytond/protocols/jsonrpc.py", line 245, in _dispatch
>     res = dispatch(*args)
>   File "/trytond/protocols/dispatcher.py", line 158, in dispatch
>     result = rpc.result(meth(*args, **kwargs))
>   File "/trytond/model/modelsql.py", line 1041, in search
>     qu1, qu2, tables, tables_args = cls.search_domain(domain)
>   File "/trytond/model/modelsql.py", line 1194, in search_domain
>     qu1, qu2 = cls.__search_domain_oper(domain, tables, tables_args)
>   File "/trytond/model/modelsql.py", line 1223, in __search_domain_oper
>     qu1, qu2 = cls.__search_domain_calc(tuple_args, tables, tables_args)
>   File "/trytond/model/modelsql.py", line 1752, in __search_domain_calc
>     ].sql_format(arg[2]))
>   File "/trytond/backend/fields.py", line 173, in sql_format
>     return int(value)
> TypeError: int() argument must be a string or a number, not 'list' 

"materiel" comme son nom ne l'indique pas est un Many2Many et donc une
list d'ids quand il est évalué. Du coup, le domain doit utiliser un
opérateur adéquat:

    [('materiel', 'in', Eval('materiel'))]

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Attachment: pgpAQU45n770X.pgp
Description: PGP signature

Répondre à