Hi, In the same idea as the changeset [1], I would like to propose this change for the write method:
@classmethod
def write(cls, records, values):
…
=>
@classmethod
def write(cls, records, values, *args):
assert not len(args) % 2
all_records = []
actions = iter((records, values) + args)
for records, values in zip(actions, actions):
…
all_records += records
cls._validate(all_records)
This has two advantages:
- call validate for a larger set of records which will benefit of
the prefetching
- reduce the number of RPC calls
PS: of course the write action in xxx2Many will follow.
http://hg.tryton.org/trytond/rev/c7804c288ca3
--
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/
pgpunuV_MCjX9.pgp
Description: PGP signature
