diff options
| author | Aaron Bohy <aab@odoo.com> | 2019-04-08 06:23:53 +0000 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2019-04-08 11:32:18 +0000 |
| commit | 7d31b863ca404bd328840f8f3288cfc3034a3559 (patch) | |
| tree | 29d0156d834cc065030399d9460419a789f050d3 /addons/web/static/src | |
| parent | 8d34eb1328b74ec3a8e3a2cc2edaeadb4c46ffbb (diff) | |
[FIX] web: list: re-evalute modifiers depending on id
In an editable (main) list view with modifiers depending on the
record id, add a new record. While the record isn't created yet,
the modifiers were correctly evaluated. However, they weren't
re-evaluted when the record was saved (thus getting an id), and a
reload of the view was necessary for the modifiers to be correctly
applied. With this rev. they are now correctly re-evaluated when
the record is saved.
closes odoo/odoo#32483
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/list/list_editable_renderer.js | 12 |
1 files changed, 12 insertions, 0 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 07363b2febd..04da1bc4983 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 @@ -428,6 +428,18 @@ ListRenderer.include({ }); } }, + /** + * @override + */ + updateState: function (state, params) { + if (params.noRender) { + // the state changed, but we won't do a re-rendering right now, so + // remove computed modifiers data (as they are obsolete) to force + // them to be recomputed at next (sub-)rendering + this.allModifiersData = []; + } + return this._super.apply(this, arguments); + }, //-------------------------------------------------------------------------- // Private |
