[FIX] stock: picking: mark as todo visibility

Always hide this button if the picking has not move lines.
This commit is contained in:
Simon Lejeune
2017-09-22 19:12:15 +02:00
parent 3b70961e38
commit b42547e7f7
+4 -2
View File
@@ -378,10 +378,12 @@ class Picking(models.Model):
picking.show_check_availability = picking.is_locked and picking.state in ('confirmed', 'waiting') and has_moves_to_reserve
@api.multi
@api.depends('state')
@api.depends('state', 'move_lines')
def _compute_show_mark_as_todo(self):
for picking in self:
if self._context.get('planned_picking') and picking.state == 'draft':
if not self.move_lines:
picking.show_mark_as_todo = False
elif self._context.get('planned_picking') and picking.state == 'draft':
picking.show_mark_as_todo = True
elif picking.state != 'draft' or not picking.id:
picking.show_mark_as_todo = False