[11.0][FIX] rma: View error in Customer/Supplier RMA Group

This commit is contained in:
Beñat Jimenez
2019-05-17 12:10:15 +02:00
parent 25d84d0b30
commit c3d7ae31a7

View File

@@ -216,6 +216,13 @@ class RmaMakePicking(models.TransientModel):
[('origin', '=', procurement)]).ids
if len(pickings) > 1:
action['domain'] = [('id', 'in', pickings)]
# In RMA Group the pickings are grouped and the origin is removed,
# so the pickings field will be empty.
if not pickings:
pickings = self.env['stock.picking'].search([(
'group_id.name', '=', self.item_ids.rma_id.name
)]).ids
action['domain'] = [('id', 'in', pickings)]
else:
form = self.env.ref('stock.view_picking_form', False)
action['views'] = [(form and form.id or False, 'form')]