summaryrefslogtreecommitdiff
path: root/addons/theme_default/data/theme_default_data.xml
diff options
context:
space:
mode:
authorfw-bot <otis@odoo.com>2019-11-07 11:20:59 +0000
committerfw-bot <otis@odoo.com>2019-11-07 15:42:02 +0000
commit6fae598d2cf32d3ca5119d86f72a96a618e71de5 (patch)
treec2e67ce9dd09a7b2a3dda8c9b09349273ae6195b /addons/theme_default/data/theme_default_data.xml
parentaca5feb6e06b0902d169aaabaa39e3af7d31534b (diff)
[FIX] web: fix crash on editable list view when moving over a RO field
In editable list view, moving to next cell using TAB key crash when the following field is read-only (i.e non-focusable) and an onchange() event is triggered. Consider an editable tree view like this: <form> <field name="o2m" onchange="1"> <tree> <field name="description"/> <field name="date" readonly="1"/> <field name="type"/> </tree> </field> </form> 1. Adding a new line will give focus to `description` field widget (currentFieldIndex is 0) 2. issuing a TAB keypress, will call _onNavigationMove which calls _selectCell() with fieldIndex of 1 3. The _selectCell() method set widget currentFieldIndex to the new value (currentFieldIndex is 1) add call _activateFieldWidget() to activate on the corresponding widget. 4. _activateFieldWidget() will fail to activate the `date` field as it's readonly, then try for next ones and succeed to activate the `type` field cell 5. When focus is given a `type`, the `description` field is blurred which trigger an onchange() and the controller apply those changes to the editable list rendererd using the confirmUpdate() method. The confirmUpdate() will try to get the current selection, but that field is actually set to the `date` field (currentFieldIndex = 1), which is readonly and so has no focusedElement - triggering the crash. This commit ensure we don't try to call getSelectionRange() it current widget has no focusable element. OPW-2075229 closes odoo/odoo#39976 X-original-commit: 93c7ae9ba5309810c41c58fc8f2fafb3c3dac76e Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Diffstat (limited to 'addons/theme_default/data/theme_default_data.xml')
0 files changed, 0 insertions, 0 deletions