[FIX] stock: check the state before put in pack

Makes consistent the Python logic and the view.

Closes #22534
opw-813477
This commit is contained in:
Florent de Labarre
2018-02-21 10:02:41 +01:00
committed by Nicolas Martinelli
parent b730de1978
commit b55e844e1a
+1 -1
View File
@@ -831,7 +831,7 @@ class Picking(models.Model):
def _put_in_pack(self):
package = False
for pick in self:
for pick in self.filtered(lambda p: p.state not in ('done', 'cancel')):
operations = pick.move_line_ids.filtered(lambda o: o.qty_done > 0 and not o.result_package_id)
operation_ids = self.env['stock.move.line']
if operations: