[FIX] stock: _compute_show_operations

Using `break` when looping over a recordset in a compute method could
have side effects. Computed field are computed in batch, according to
the order of the recordset, the value may only be computed correctly for
some records

related to rev c493569866

opw-1833347
This commit is contained in:
Simon Lejeune
2018-04-05 10:18:22 +02:00
parent 6397ce7eb0
commit 0cdfae0e25
+1 -1
View File
@@ -315,7 +315,7 @@ class Picking(models.Model):
for picking in self:
if self.env.context.get('force_detailed_view'):
picking.show_operations = True
break
continue
if picking.picking_type_id.show_operations:
if (picking.state == 'draft' and not self.env.context.get('planned_picking')) or picking.state != 'draft':
picking.show_operations = True