mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user