Comment 3 for bug 956234

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : Re: Code error: schedulers.py order kwarg in read method

Hello,

I don't have any procedure to reproduce the steps which lead to the portion of code impacted.

But one thing I'm sure is that the method read doesn't accept the argument "order" as it is actually at line 270:
procure_datas = procurement_obj.read(cr, uid, pro_ids, ['id', 'product_qty'], context=context, order='product_qty desc')

This leads to the error :
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: read() got an unexpected keyword argument 'order'

I've attached a branch with the fix. The sort here is not necessary, this is a very very small optimization in order to reduce the number of loops.

I know you prefer to have steps to reproduce the issue, but thats a coding error, it's easy to check the signature of the method read and check that there is no "order" nor **kwargs arguments.

Thanks
Guewen