From c7b5b12be6b6faf6b58057a64d5f7ba1e57b85fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Thu, 8 Mar 2018 16:34:01 +0100 Subject: [FIX] web: add the node attribute to the form view widget This could (should?) be considered a refactoring, but this is actually trying to restore lost functionality. In v10, the custom form widgets were created with access to the node element that define them. We lost that in v11, with the new views. However, it is actually very useful for generic widgets. Since this is not really a risky fix, I think that it can be done in 11.0. Note: this feature was already reintroduced in master in commit https://github.com/odoo/odoo/commit/b7aa439826df6b3e442b3f60bb593ff28efc8679 --- addons/web/static/src/js/views/basic/basic_renderer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_renderer.js') diff --git a/addons/web/static/src/js/views/basic/basic_renderer.js b/addons/web/static/src/js/views/basic/basic_renderer.js index 204c35acaef..4b22a5dc66f 100644 --- a/addons/web/static/src/js/views/basic/basic_renderer.js +++ b/addons/web/static/src/js/views/basic/basic_renderer.js @@ -607,7 +607,7 @@ var BasicRenderer = AbstractRenderer.extend({ */ _renderWidget: function (record, node) { var Widget = widgetRegistry.get(node.attrs.name); - var widget = new Widget(this, record); + var widget = new Widget(this, record, node); this.widgets.push(widget); -- cgit v1.2.3