Hi,

As we already changed most part of the Function fields, I think we should also
improve the "search" part.

Currently, the search function must have this signature:

    def search_xxx(self, cursor, user, name, args, context=None)

where args is a list of domain clause.

But indeed, there is always only one clause like you can see in [1].
So I propose to change the args list into one clause:

    def search_xxx(self, cursor, user, name, clause, context=None)

And this will allow to remove many unnecessary loops all over the code and
remove the "while" coding style as asked in issue1143 [2].


[1]
http://hg.tryton.org/hgwebdir.cgi/trytond/file/5aba4c201f2b/trytond/model/modelsql.py#l1438
[2] http://bugs.tryton.org/roundup/issue1143

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgp5kfKSV9s0e.pgp
Description: PGP signature

Reply via email to