Skip to content
Snippets Groups Projects
Commit 86897ca1 authored by Géry Debongnie's avatar Géry Debongnie
Browse files

[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.
parent f39b1bb4
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment