[REF] web: remove updateModifiersValue from widget

The keyboard shortcut branch recently added a method
updateModifiersValue on the widget class, which is used to make a widget
aware of its modifier status (in particular, if it is required).  This
is necessary for the proper navigation behaviour on field widgets, but
should not be on the widget class.

The proper fix is, in my opinion, to introduce a AbstractViewWidget
class which would be used for AbstractField and all custom widgets in
views.

Meanwhile, this commit simply protects the call to that method. This is a
refactoring, but can be merged in saas-11.3.
This commit is contained in:
Géry Debongnie
2018-04-11 11:51:49 +02:00
parent f39b1bb446
commit 86897ca167
2 changed files with 1 additions and 11 deletions
-10
View File
@@ -284,16 +284,6 @@ var Widget = core.Class.extend(mixins.PropertiesMixin, ServicesMixin, {
return this;
},
/**
* Update the modifiers with the newest value.
* Now this.attrs.modifiersValue can be used consistantly even with
* conditional modifiers
*
* @param {Object} modifiers the updated modifiers
*/
updateModifiersValue: function(modifiers) {
},
//--------------------------------------------------------------------------
// Private
@@ -278,7 +278,7 @@ var BasicRenderer = AbstractRenderer.extend({
element.$el.toggleClass("o_readonly_modifier", !!modifiers.readonly);
element.$el.toggleClass("o_required_modifier", !!modifiers.required);
if (element.widget) {
if (element.widget && element.widget.updateModifiersValue) {
element.widget.updateModifiersValue(modifiers);
}