diff options
| author | Jinal Patel <jip@odoo.com> | 2019-07-30 06:19:09 +0000 |
|---|---|---|
| committer | svs-odoo <svs@odoo.com> | 2019-08-30 13:55:56 +0000 |
| commit | 5a1fb85ef681d1197f22b7c1e2ed8a9fc2898cac (patch) | |
| tree | f0ab158ea3aca33e2343d1c825ef14a3abc224da /addons/web/static/src/js | |
| parent | 50464f54613449be0f9be7b586e2810fc2da4403 (diff) | |
[FIX] web: support oe_read_only and oe_edit_only in x2m list
Back-ported from the master,
commit ca9a733b27a1680403961eaa13cc62e5aa58a8fb
Before this rev., classNames 'oe_read_only' (only display in
readonly mode) and 'oe_edit_only' (only display in edit mode)
didn't work in x2m lists inside form views (only the cells in the
tbody were hidden, but not the header). This rev. makes this work.
Task 1949618
closes odoo/odoo#36117
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
closes odoo/odoo#36285
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/views/list/list_renderer.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/list/list_renderer.js b/addons/web/static/src/js/views/list/list_renderer.js index 31300ae53d1..8138b225528 100644 --- a/addons/web/static/src/js/views/list/list_renderer.js +++ b/addons/web/static/src/js/views/list/list_renderer.js @@ -745,6 +745,14 @@ var ListRenderer = BasicRenderer.extend({ var isNodeSorted = order[0] && order[0].name === name; var field = this.state.fields[name]; var $th = $('<th>'); + if (node.attrs.class) { + if (node.attrs.class.indexOf('oe_edit_only') !== -1) { + $th.addClass('oe_edit_only'); + } + if (node.attrs.class.indexOf('oe_read_only') !== -1) { + $th.addClass('oe_read_only'); + } + } if (!field) { return $th; } |
