diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2018-03-16 11:31:44 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2018-03-16 13:30:25 +0100 |
| commit | 4e507faaafdf5bd0a048106159663d01c820d866 (patch) | |
| tree | 2898e4843e3f7f28e03c0420099b05b9415db70f /addons/web_editor/controllers | |
| parent | 00057f8efd3c728e13a981290a725878e058d2c6 (diff) | |
[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 6494f511718893eec3573c60c0a62e04d386359d
opw-1824673
Diffstat (limited to 'addons/web_editor/controllers')
| -rw-r--r-- | addons/web_editor/controllers/main.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web_editor/controllers/main.py b/addons/web_editor/controllers/main.py index cc8d91cbaef..c18978056f4 100644 --- a/addons/web_editor/controllers/main.py +++ b/addons/web_editor/controllers/main.py @@ -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 |
