From 95d14e1b8573498e0c72382b758e953644013106 Mon Sep 17 00:00:00 2001 From: SergiCForgeFlow Date: Tue, 4 Apr 2023 11:45:50 +0200 Subject: [PATCH] [FIX] Restrict approval rights to RMA Manager --- rma/models/rma_order_line.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rma/models/rma_order_line.py b/rma/models/rma_order_line.py index f9e03741a..c26a70274 100644 --- a/rma/models/rma_order_line.py +++ b/rma/models/rma_order_line.py @@ -647,7 +647,11 @@ def action_rma_draft(self): return True def action_rma_approve(self): - self.write({"state": "approved"}) + if self.env.user.has_group('rma.group_rma_manager'): + self.write({"state": "approved"}) + else: + raise UserError(_('You have no access rights to approve this RMA')) + return True def action_rma_done(self):