From 9877f24e23f6d8b3d03dd35d946341bf06f9d8cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20Alan=20Ramos=20Rodri=CC=81guez?= Date: Fri, 7 Jan 2022 08:30:00 -0600 Subject: [PATCH] [FIX] stock_request: use sudo to run procurements to prevent permission issues This fixes the following issue: If a user make a request of a product that you need to manufacture, but the user don't have permissions to mrp module and you don't want to give them access, it will raises an error thad you don't have permissions to see the mrp.bom. --- stock_request/models/stock_request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_request/models/stock_request.py b/stock_request/models/stock_request.py index f8eea964e..1c7a8cb75 100644 --- a/stock_request/models/stock_request.py +++ b/stock_request/models/stock_request.py @@ -340,7 +340,7 @@ class StockRequest(models.Model): values, ) ) - self.env["procurement.group"].run(procurements) + self.env["procurement.group"].sudo().run(procurements) except UserError as error: errors.append(error.name) if errors: