[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.
This commit is contained in:
Jesús Alan Ramos Rodríguez
2022-01-07 08:30:00 -06:00
parent b78f1ccffe
commit 9877f24e23

View File

@@ -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: