Duplicate in records in method calls
I just found in this code [1] that if it is called with a list of records which contains duplicates it will create many moves for the same invoice.
I think most of our code is based on the fact that records list should have the same property as ordered sets.
So I'm wondering if we should fix by ensuring the assumption in each method that requires it. Ex: records = cls.browse(set(records))
But this will be quite expensive in terms of cache management.
Of if we should consider as a bug if code does not call with proper values. Ex: assert len(records) != set(records)
But we will have to ensure that when instantiate in RPC.
This has the advantage to cost nothing on production.
[1] http://hg.tryton.org/modules/account_invoice/file/default/invoice.py#l1315