[FIX] purchase: do not show all pickings from PO if there are no picking

Closes #19961.
This commit is contained in:
Thomas Binsfeld
2018-06-13 12:05:17 +02:00
committed by Thibault Delavallée
parent bb8ded772a
commit 4d3debe2c3
+1 -1
View File
@@ -477,7 +477,7 @@ class PurchaseOrder(models.Model):
result['context'] = {}
pick_ids = self.mapped('picking_ids')
#choose the view_mode accordingly
if len(pick_ids) > 1:
if not pick_ids or len(pick_ids) > 1:
result['domain'] = "[('id','in',%s)]" % (pick_ids.ids)
elif len(pick_ids) == 1:
res = self.env.ref('stock.view_picking_form', False)