[FIX] web_editor: type of res_id
- Set the demo user to have access to all quotations
- Connect as demo, create a quote and send the message
- In the message try to upload an image
An access error is raised, although the user can write on the record.
This is because the `res_id` received is a `string`, not an `int`.
Therefore, the access check fails.
Introduced with 6494f51171
opw-1824673
This commit is contained in:
committed by
Nicolas Martinelli
parent
00057f8efd
commit
4e507faaaf
@@ -147,7 +147,10 @@ class Web_Editor(http.Controller):
|
||||
Attachments = request.env['ir.attachment'] # registry for the attachment table
|
||||
|
||||
res_model = kwargs.get('res_model', 'ir.ui.view')
|
||||
res_id = res_model != 'ir.ui.view' and kwargs.get('res_id') or None
|
||||
if res_model != 'ir.ui.view' and kwargs.get('res_id'):
|
||||
res_id = int(kwargs['res_id'])
|
||||
else:
|
||||
None
|
||||
|
||||
uploads = []
|
||||
message = None
|
||||
|
||||
Reference in New Issue
Block a user