On 29 May 16:47, Raimon Esteve wrote: > Yes, it is => A transaction is very longer. For example, try assing > 500 shipments it will be spent some long time (~ 10 o 15 minuts) and > stock.move is locked.
By the way, the 'assign_try' method on shipment does assign all shipments or none. So it makes even no sense to run it inside one single transaction with the 500. I also see that Move.assign_try is designed with the idea that there is only one unique move per product which could not be and so reduce the performance a little. https://bugs.tryton.org/issue4782 Also the Move.assign_try could query many times the location to get children. This could be cached if almost all the move are from the same location (which is highly probable). https://bugs.tryton.org/issue4783 Finally, we write on each move one by one the result of the assignation. It could maybe optimized to use the grouped writes but this one is tricky. https://bugs.tryton.org/issue4784 -- Cédric Krier - B2CK SPRL Email/Jabber: [email protected] Tel: +32 472 54 46 59 Website: http://www.b2ck.com/
