[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user