diff options
| author | Julien Mougenot <jum@odoo.com> | 2019-09-03 15:21:04 +0000 |
|---|---|---|
| committer | Julien Mougenot <jum@odoo.com> | 2019-09-04 08:19:32 +0000 |
| commit | eea560060a6e01c39ae41fd0c4fd8e387f18e418 (patch) | |
| tree | 0e1a7c33eadc1efa709f61dc0e16542aa0d28290 /addons/web/static/src | |
| parent | 52bd5fa46183b6baf6c03969162f2c0cad6ce478 (diff) | |
[FIX] web: list width should not be calculated when invisible
Before this commit, the width of the headers in a list were frozen
only when the list was seen, but the calculation of the width might have
happened while it was invisible (thus giving the headers 0px).
Now, the freeze AND the calculation only occur when the list is visible
and can actually be evaluated.
Task 2061848
closes odoo/odoo#36175
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/list/list_editable_renderer.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/list/list_editable_renderer.js b/addons/web/static/src/js/views/list/list_editable_renderer.js index 8e9bead963b..d9cc1115917 100644 --- a/addons/web/static/src/js/views/list/list_editable_renderer.js +++ b/addons/web/static/src/js/views/list/list_editable_renderer.js @@ -507,7 +507,9 @@ ListRenderer.include({ */ updateState: function (state, params) { this.columnWidths = false; - if (params.keepWidths) { + // There are some cases where a record is added to an invisible list + // e.g. set a quotation template with optionnal products + if (params.keepWidths && this.$el.is(':visible')) { this.columnWidths = this.$('thead th').toArray().map(function (th) { return $(th).outerWidth(); }); |
