diff options
| author | Michael Mattiello (mcm) <mcm@odoo.com> | 2020-04-15 12:09:56 +0000 |
|---|---|---|
| committer | Michael Mattiello (mcm) <mcm@odoo.com> | 2020-04-16 07:19:55 +0000 |
| commit | f0aa343fe2d5680b27895e13b9962b3c4a9b9881 (patch) | |
| tree | 1430c2eeb45df9c3c3680b971ff0fdccfd8e63a7 /addons/web/static | |
| parent | dcf9a4c38da5d50a6e597d3d68c3d46fdef61df5 (diff) | |
[REF] web,mail: use patchMixin and patch instead of utils.patch
This commit replaces the use of utils.patch by the new class patcher and
makes the renderers that are converted to owl patchable.
closes odoo/odoo#47700
Related: odoo/enterprise#9551
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Diffstat (limited to 'addons/web/static')
4 files changed, 7 insertions, 4 deletions
diff --git a/addons/web/static/src/js/control_panel/control_panel.js b/addons/web/static/src/js/control_panel/control_panel.js index d7105806de4..fee26c3779d 100644 --- a/addons/web/static/src/js/control_panel/control_panel.js +++ b/addons/web/static/src/js/control_panel/control_panel.js @@ -6,6 +6,7 @@ odoo.define('web.ControlPanel', function (require) { const FavoriteMenu = require('web.FavoriteMenu'); const FilterMenu = require('web.FilterMenu'); const GroupByMenu = require('web.GroupByMenu'); + const patchMixin = require('web.patchMixin'); const Pager = require('web.Pager'); const SearchBar = require('web.SearchBar'); const TimeRangeMenu = require('web.TimeRangeMenu'); @@ -221,5 +222,5 @@ odoo.define('web.ControlPanel', function (require) { ControlPanel.template = 'web.ControlPanel'; - return ControlPanel; + return patchMixin(ControlPanel); }); diff --git a/addons/web/static/src/js/control_panel/custom_filter_item.js b/addons/web/static/src/js/control_panel/custom_filter_item.js index 40265e95fe2..b1f414eac5f 100644 --- a/addons/web/static/src/js/control_panel/custom_filter_item.js +++ b/addons/web/static/src/js/control_panel/custom_filter_item.js @@ -6,6 +6,7 @@ odoo.define('web.CustomFilterItem', function (require) { const DropdownMenuItem = require('web.DropdownMenuItem'); const { FIELD_OPERATORS, FIELD_TYPES } = require('web.searchUtils'); const field_utils = require('web.field_utils'); + const patchMixin = require('web.patchMixin'); const { useModel } = require('web.model'); /** @@ -254,5 +255,5 @@ odoo.define('web.CustomFilterItem', function (require) { }; CustomFilterItem.template = 'web.CustomFilterItem'; - return CustomFilterItem; + return patchMixin(CustomFilterItem); }); diff --git a/addons/web/static/src/js/core/utils.js b/addons/web/static/src/js/core/utils.js index e8924747616..1e3c6074857 100644 --- a/addons/web/static/src/js/core/utils.js +++ b/addons/web/static/src/js/core/utils.js @@ -531,7 +531,7 @@ var utils = { * This function is the last resort solution for monkey-patching an * ES6 Class, for people that do not control the code defining the Class * to patch (e.g. partners), and when that Class isn't patchable already - * (i.e. when it doesn't have a 'patch' function, defined by the 'web.PatchMixin'). + * (i.e. when it doesn't have a 'patch' function, defined by the 'web.patchMixin'). * * @param {Class} C Class to patch * @param {string} patchName diff --git a/addons/web/static/src/js/views/pivot/pivot_renderer.js b/addons/web/static/src/js/views/pivot/pivot_renderer.js index 3b91cb137d4..8335c7c29f5 100644 --- a/addons/web/static/src/js/views/pivot/pivot_renderer.js +++ b/addons/web/static/src/js/views/pivot/pivot_renderer.js @@ -3,6 +3,7 @@ odoo.define('web.PivotRenderer', function (require) { const OwlAbstractRenderer = require('web.AbstractRendererOwl'); const field_utils = require('web.field_utils'); + const patchMixin = require('web.patchMixin'); const { useExternalListener, useState, onMounted, onPatched } = owl.hooks; @@ -198,6 +199,6 @@ odoo.define('web.PivotRenderer', function (require) { PivotRenderer.template = 'web.PivotRenderer'; - return PivotRenderer; + return patchMixin(PivotRenderer); }); |
