summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-11-02 15:13:48 +0100
committerXavier Morel <xmo@openerp.com>2012-11-02 15:13:48 +0100
commit72a447bd95b2abc026e6ffbc9807e0229aa2dae1 (patch)
tree7b9aa793823a38d42264422864858262e890850b /addons/web/static/src/js
parent956bfd007d8f8be75d7277bae76e5263b811ce5c (diff)
[FIX] tabbing out of an m2o which opens some sort of weird dialog thing while in an editable o2m
The tab blurs the current fields, focuses the next one, then the dialog thing opens and steals the focus from the *next* field (not the one which created it), which thus triggers *blur* ultimately blurring (and saving) the row being edited. Add a trigger call in some random place which seems to make things not fail. bzr revid: xmo@openerp.com-20121102141348-5au6sarq0mw2ct67
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/view_form.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index e0727b99259..9dd6e34c161 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -2955,7 +2955,7 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
self.uned_def = $.Deferred();
var ed_delay = 200;
var ed_duration = 15000;
- var anyoneLoosesFocus = function() {
+ var anyoneLoosesFocus = function (e) {
var used = false;
if (self.floating) {
if (self.last_search.length > 0) {
@@ -2979,7 +2979,10 @@ instance.web.form.FieldMany2One = instance.web.form.AbstractField.extend(instanc
self.ed_def = $.Deferred();
self.ed_def.then(function() {
self.show_error_displayer();
+ ignore_blur = false;
+ self.trigger('focused');
});
+ ignore_blur = true;
setTimeout(function() {
self.ed_def.resolve();
self.uned_def.reject();