diff options
| author | Samuel Degueldre <sad@odoo.com> | 2020-04-22 11:24:42 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-06-05 18:11:25 +0000 |
| commit | 629a93274e138a629748ca75d86abe59fe640a3a (patch) | |
| tree | 3fccf1c4b9d73173c1b0de43654bb23dba2b62fe /addons/web_editor/controllers | |
| parent | a904a63833859e64e30fbde9d64e34568e6b39a7 (diff) | |
[REF] web_editor: remove relics of filter feature
Previously, the media-dialog had a "filter" feature, where when changing
a background image for example, all backgrounds would show first in the
media-dialog. However, because this required to load all public
attachments in the database it was causing issues and was removed. The
backend code for this feature however was unfortunately forgotten, this
commit removes that code.
Part of https://github.com/odoo/odoo/pull/51517
Diffstat (limited to 'addons/web_editor/controllers')
| -rw-r--r-- | addons/web_editor/controllers/main.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/addons/web_editor/controllers/main.py b/addons/web_editor/controllers/main.py index cd8ade0f108..f8b844b176c 100644 --- a/addons/web_editor/controllers/main.py +++ b/addons/web_editor/controllers/main.py @@ -155,17 +155,17 @@ class Web_Editor(http.Controller): return True @http.route('/web_editor/attachment/add_data', type='json', auth='user', methods=['POST'], website=True) - def add_data(self, name, data, quality=0, width=0, height=0, res_id=False, res_model='ir.ui.view', filters=False, **kwargs): + def add_data(self, name, data, quality=0, width=0, height=0, res_id=False, res_model='ir.ui.view', **kwargs): try: data = tools.image_process(data, size=(width, height), quality=quality, verify_resolution=True) except UserError: pass # not an image - attachment = self._attachment_create(name=name, data=data, res_id=res_id, res_model=res_model, filters=filters) + attachment = self._attachment_create(name=name, data=data, res_id=res_id, res_model=res_model) return attachment._get_media_info() @http.route('/web_editor/attachment/add_url', type='json', auth='user', methods=['POST'], website=True) - def add_url(self, url, res_id=False, res_model='ir.ui.view', filters=False, **kwargs): - attachment = self._attachment_create(url=url, res_id=res_id, res_model=res_model, filters=filters) + def add_url(self, url, res_id=False, res_model='ir.ui.view', **kwargs): + attachment = self._attachment_create(url=url, res_id=res_id, res_model=res_model) return attachment._get_media_info() @http.route('/web_editor/attachment/<model("ir.attachment"):attachment>/update', type='json', auth='user', methods=['POST'], website=True) @@ -245,7 +245,7 @@ class Web_Editor(http.Controller): result['originalSrc'] = record.url return result - def _attachment_create(self, name='', data=False, url=False, res_id=False, res_model='ir.ui.view', filters=None): + def _attachment_create(self, name='', data=False, url=False, res_id=False, res_model='ir.ui.view'): """Create and return a new attachment.""" if not name and url: name = url.split("/").pop() @@ -255,9 +255,6 @@ class Web_Editor(http.Controller): else: res_id = False - if filters: - name = filters + '_' + name - attachment_data = { 'name': name, 'public': res_model == 'ir.ui.view', |
