diff options
| author | Thanh Dodeur <tso@odoo.com> | 2019-04-05 08:11:26 +0000 |
|---|---|---|
| committer | Thanh Dodeur <tso@odoo.com> | 2019-06-05 09:12:13 +0000 |
| commit | c212cfe8992292f57acacd809de26e1817533095 (patch) | |
| tree | 4ab6e06aa7e9e74087bc81fac2047b7c113ea941 /addons/web_editor/static | |
| parent | d6847bacb1d2425466003985f9e96837f22c2148 (diff) | |
[REF] *: removes datas_fname from ir.attachment
This commit removes the field `datas_fname` from `ir.attachment` as
it was unnecessary and most of the time the duplicate of `name` or
`url`.
Task #1909865
closes odoo/odoo#32976
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Diffstat (limited to 'addons/web_editor/static')
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/plugin/media.js | 1 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/widgets/media.js | 8 | ||||
| -rw-r--r-- | addons/web_editor/static/tests/test_utils.js | 5 |
3 files changed, 4 insertions, 10 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/media.js b/addons/web_editor/static/src/js/wysiwyg/plugin/media.js index 8ff6a100627..b11c15b2564 100644 --- a/addons/web_editor/static/src/js/wysiwyg/plugin/media.js +++ b/addons/web_editor/static/src/js/wysiwyg/plugin/media.js @@ -800,7 +800,6 @@ var ImagePlugin = AbstractMediaPlugin.extend({ res_model: resModel, res_id: resID, name: name, - datas_fname: name, datas: datas, mimetype: mimetype, url: originalSrc, // To save the original image that was cropped diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js index 3303ec0a58f..545f06a38e2 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js @@ -233,13 +233,13 @@ var FileWidget = SearchableMediaWidget.extend({ .sortBy(function (r) { if (_.any(self.options.firstFilters, function (filter) { var regex = new RegExp(filter, 'i'); - return r.name.match(regex) || r.name && r.name.match(regex); + return r.name && r.name.match(regex); })) { return -1; } if (_.any(self.options.lastFilters, function (filter) { var regex = new RegExp(filter, 'i'); - return r.name.match(regex) || r.name && r.name.match(regex); + return r.name && r.name.match(regex); })) { return 1; } @@ -323,9 +323,9 @@ var FileWidget = SearchableMediaWidget.extend({ domain = ['|', ['public', '=', true]].concat(domain); domain = domain.concat(this.options.mimetypeDomain); if (needle && needle.length) { - domain.push('|', ['name', 'ilike', needle], ['name', 'ilike', needle]); + domain.push(['name', 'ilike', needle]); } - domain.push('|', ['name', '=', false], '!', ['name', '=like', '%.crop'], '!', ['name', '=like', '%.crop']); + domain.push('!', ['name', '=like', '%.crop']); domain.push('|', ['type', '=', 'binary'], ['url', '!=', false]); return domain; }, diff --git a/addons/web_editor/static/tests/test_utils.js b/addons/web_editor/static/tests/test_utils.js index 0501baee4ea..99510bb3bae 100644 --- a/addons/web_editor/static/tests/test_utils.js +++ b/addons/web_editor/static/tests/test_utils.js @@ -319,10 +319,6 @@ function wysiwygData(data) { string: "display_name", type: 'char', }, - datas_fname: { - string: "datas_fname", - type: 'char', - }, mimetype: { string: "mimetype", type: 'char', @@ -371,7 +367,6 @@ function wysiwygData(data) { records: [{ id: 1, name: 'image', - datas_fname: 'image.png', mimetype: 'image/png', checksum: false, url: '/web_editor/static/src/img/transparent.png', |
