Skip to content
Snippets Groups Projects
Commit 7b306fc1 authored by Thomas Groutars's avatar Thomas Groutars Committed by Denis Ledoux
Browse files

[IMP] stock: improve detailed transfer performance

Transfers were slowed because of the continuous
computation of pickings remaining quantities.

This revision delay the computation at the end of the transfer,
so the computation is performed only once, and it
therefore leads to a huge performance improvment.

opw-634416
parent 453b373a
No related branches found
No related tags found
No related merge requests found
......@@ -91,7 +91,7 @@ class stock_transfer_details(models.TransientModel):
'owner_id': prod.owner_id.id,
}
if prod.packop_id:
prod.packop_id.write(pack_datas)
prod.packop_id.with_context(no_recompute=True).write(pack_datas)
processed_ids.append(prod.packop_id.id)
else:
pack_datas['picking_id'] = self.picking_id.id
......@@ -99,8 +99,7 @@ class stock_transfer_details(models.TransientModel):
processed_ids.append(packop_id.id)
# Delete the others
packops = self.env['stock.pack.operation'].search(['&', ('picking_id', '=', self.picking_id.id), '!', ('id', 'in', processed_ids)])
for packop in packops:
packop.unlink()
packops.unlink()
# Execute the transfer of the picking
self.picking_id.do_transfer()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment