[ADD] create new record when clicking on an empty row

bzr revid: xmo@openerp.com-20120711111027-6vtyoxx17fw8dmvc
This commit is contained in:
Xavier Morel 2012-07-11 13:10:27 +02:00
parent c0e9d320f3
commit 3efc9c033a
2 changed files with 8 additions and 1 deletions

View File

@ -1006,9 +1006,9 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
e.stopPropagation();
})
.delegate('tr', 'click', function (e) {
e.stopPropagation();
var row_id = self.row_id(e.currentTarget);
if (row_id !== undefined) {
e.stopPropagation();
if (!self.dataset.select_id(row_id)) {
throw "Could not find id in dataset"
}

View File

@ -104,6 +104,13 @@ openerp.web.list_editable = function (instance) {
this.$buttons
.off('click', 'button.oe_list_save')
.on('click', 'button.oe_list_save', this.proxy('saveEdition'));
this.$element
.off('click', 'tbody tr')
.on('click', 'tbody tr', function () {
if (!self.editor.isEditing()) {
self.startEdition();
}
});
// Editor is not restartable due to formview not being
// restartable
this.editor = this.makeEditor();