summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/view_list_editable.js
diff options
context:
space:
mode:
authorMohammed Shekha <msh@openerp.com>2014-09-10 16:18:54 +0200
committerMartin Trigaux <mat@openerp.com>2014-09-10 16:19:22 +0200
commitf8b48c8d61f587aa3be0d249efefc313dde1f574 (patch)
tree017d3f9a9622db933fd030508b15926ad4cb94c9 /addons/web/static/src/js/view_list_editable.js
parentbae5a75ce1847a89ca1c3557c732c46fc04022a8 (diff)
[FIX] web: focus field in editable listview
If one click on empty area of button at that time we should set focus of the field based on field order. Do not evict record from dataset, otherwise it will go to read from database and will do server call for read, if user is cancelling in one2many then there is no need to read record from database, this will also fix the issue of unorder execution of event trigger. (opw 613100)
Diffstat (limited to 'addons/web/static/src/js/view_list_editable.js')
-rw-r--r--addons/web/static/src/js/view_list_editable.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js
index 62a0717d374..831d383c731 100644
--- a/addons/web/static/src/js/view_list_editable.js
+++ b/addons/web/static/src/js/view_list_editable.js
@@ -255,7 +255,7 @@
$recordRow.addClass('oe_edition');
self.resize_fields();
var focus_field = options && options.focus_field ? options.focus_field : undefined;
- if (!focus_field){
+ if (!focus_field || !fields[focus_field]){
focus_field = _.find(self.editor.form.fields_order, function(field){ return fields[field] && fields[field].$el.is(':visible:has(input)'); });
}
if (focus_field && fields[focus_field]) fields[focus_field].$el.find('input').select();
@@ -364,7 +364,7 @@
// Record removed by third party during edition
return;
}
- return self.reload_record(record);
+ return self.reload_record(record, {do_not_evict: true});
}
var to_delete = self.records.find(function (r) {
return !r.get('id');
@@ -805,7 +805,7 @@
var record_id = $(event.currentTarget).data('id');
return this.view.start_edition(
record_id ? this.records.get(record_id) : null, {
- focus_field: $(event.target).data('field')
+ focus_field: $(event.target).not(".oe_readonly").data('field')
});
},
/**