[FIX] rma: non rma users confirm

The sudo had to be before calling the records
This commit is contained in:
david
2020-10-15 16:48:23 +02:00
parent d1845596ac
commit 934954e1a6

View File

@@ -57,7 +57,7 @@ class StockMove(models.Model):
"""
for move in self.filtered(
lambda r: r.state not in ('done', 'cancel')):
rma_receiver = move.rma_receiver_ids.sudo()
rma_receiver = move.sudo().rma_receiver_ids
if (rma_receiver
and move.quantity_done != rma_receiver.product_uom_qty):
raise ValidationError(