diff options
| author | Denis Ledoux <dle@openerp.com> | 2014-04-08 14:01:41 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@openerp.com> | 2014-04-08 14:01:41 +0200 |
| commit | a16b0c79079c045206f81b2d02edf729673eeb97 (patch) | |
| tree | e70cf7d7d5e457dedbf9404269ab78bcbc6fb736 /addons/web/static/src/js/view_list_editable.js | |
| parent | 7dc732af6cc21d3e3f8f850433ffc629f4436e95 (diff) | |
[IMP] web: select input on add record in list editable
bzr revid: dle@openerp.com-20140408120141-f1fx2e9e8vqatccx
Diffstat (limited to 'addons/web/static/src/js/view_list_editable.js')
| -rw-r--r-- | addons/web/static/src/js/view_list_editable.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 53ea069cee6..c4aac5565ab 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -123,10 +123,19 @@ openerp.web.list_editable = function (instance) { * as an editable row at the top or bottom of the list) */ do_add_record: function () { + var self = this; if (this.editable()) { this.$el.find('table:first').show(); this.$el.find('.oe_view_nocontent').remove(); - this.start_edition(); + this.start_edition().then(function(){ + var fields = self.editor.form.fields; + self.editor.form.fields_order.some(function(field){ + if (fields[field].$el.is(':visible')){ + fields[field].$el.find("input").select(); + return true; + } + }); + }); } else { this._super(); } |
