summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/form
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2020-09-15 12:35:48 +0000
committerAaron Bohy <aab@odoo.com>2020-09-15 15:01:51 +0000
commit8edfe6b32f779d8f0428e7be7a335fdfa7e44a89 (patch)
tree8e307feeb8f4fedb5e16d8142d7054c29228c8bd /addons/web/static/src/js/views/form
parentd2901cfbf6ad5b357a414293a954d906f425fa3a (diff)
[FIX] web: list: call mounted on subcomponents at reload
Issue was spotted in list views containing the "badge" widget with decorations (e.g. in the Purchase Order list view). At first, the decorations were correctly applied, but they weren't anymore after a reload (e.g. after toggling a filter). They weren't because the list renderer didn't called 'on_attach_callback' on its subwidgets at reload (thus, 'mounted' wasn't called on its subcomponents, and the decorations are applied in the mounted hook). This commit moves the logic from the FormRenderer to the BasicRenderer, so that it applies on List, Kanban, and Form views. This commit also removes the transition scss rule on the badge field widget as it caused a flickering at reload. Task 2336440 closes odoo/odoo#57762 X-original-commit: 713bce22e8f412f2c26e663b9e30fdd64933ff0c Signed-off-by: Michaƫl Mattiello <mcm-odoo@users.noreply.github.com> Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/views/form')
-rw-r--r--addons/web/static/src/js/views/form/form_renderer.js21
1 files changed, 0 insertions, 21 deletions
diff --git a/addons/web/static/src/js/views/form/form_renderer.js b/addons/web/static/src/js/views/form/form_renderer.js
index 97e3cbd8cb0..b6e1593b215 100644
--- a/addons/web/static/src/js/views/form/form_renderer.js
+++ b/addons/web/static/src/js/views/form/form_renderer.js
@@ -52,21 +52,6 @@ var FormRenderer = BasicRenderer.extend({
this._applyFormSizeClass();
return this._super.apply(this, arguments);
},
- /**
- * Called each time the form view is attached into the DOM
- */
- on_attach_callback: function () {
- this._isInDom = true;
- _.invoke(this.widgets, 'on_attach_callback');
- this._super.apply(this, arguments);
- },
- /**
- * Called each time the renderer is detached from the DOM.
- */
- on_detach_callback: function () {
- this._isInDom = false;
- this._super.apply(this, arguments);
- },
//--------------------------------------------------------------------------
// Public
@@ -1053,12 +1038,6 @@ var FormRenderer = BasicRenderer.extend({
if (self.lastActivatedFieldIndex >= 0) {
self._activateNextFieldWidget(self.state, self.lastActivatedFieldIndex);
}
- if (self._isInDom) {
- _.forEach(self.allFieldWidgets, function (widgets){
- _.invoke(widgets, 'on_attach_callback');
- });
- _.invoke(self.widgets, 'on_attach_callback');
- }
}).guardedCatch(function () {
$form.remove();
});