[FIX] use native DOM methods to programmatically set focus on an element
authorXavier Morel <xmo@openerp.com>
Tue, 17 Jul 2012 13:02:51 +0000 (15:02 +0200)
committerXavier Morel <xmo@openerp.com>
Tue, 17 Jul 2012 13:02:51 +0000 (15:02 +0200)
commitc3368bf2bbd779b1dd9e2bbc202cf85845803030
tree1282f019576d4e43cb2fffe6c16c2f5a7deeae49
parent75c2845fb5414a65a7366273eda3c1234d5d43b9
[FIX] use native DOM methods to programmatically set focus on an element

jQuery breaks the expected ordering of triggered consequential events
to a focusing (a blur event on the source field, a focus event on the
destination one), which in turn breaks the expectations of the
auto-saving o2m, making the o2m field attempt to auto-save immediately
after having saved a row (via the [Return] key) e.g. create a new row
in a list o2m, press [Return], the widget creates a new empty row and
immediately tries to save it resulting — depending on the view's setup
— in either an empty row being saved or a bunch of fields being marked
as invalid even though the user hasn't done anything yet.

Bypass jquery to avoid this issue.

jQuery tracker ref: http://bugs.jquery.com/ticket/12094

bzr revid: xmo@openerp.com-20120717130251-q2cjoj6rkxh0bvdq
addons/web/static/src/js/view_form.js