[ADD] create new record when clicking on an empty row
bzr revid: xmo@openerp.com-20120711111027-6vtyoxx17fw8dmvc
This commit is contained in:
parent
c0e9d320f3
commit
3efc9c033a
|
@ -1006,9 +1006,9 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
})
|
})
|
||||||
.delegate('tr', 'click', function (e) {
|
.delegate('tr', 'click', function (e) {
|
||||||
e.stopPropagation();
|
|
||||||
var row_id = self.row_id(e.currentTarget);
|
var row_id = self.row_id(e.currentTarget);
|
||||||
if (row_id !== undefined) {
|
if (row_id !== undefined) {
|
||||||
|
e.stopPropagation();
|
||||||
if (!self.dataset.select_id(row_id)) {
|
if (!self.dataset.select_id(row_id)) {
|
||||||
throw "Could not find id in dataset"
|
throw "Could not find id in dataset"
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,13 @@ openerp.web.list_editable = function (instance) {
|
||||||
this.$buttons
|
this.$buttons
|
||||||
.off('click', 'button.oe_list_save')
|
.off('click', 'button.oe_list_save')
|
||||||
.on('click', 'button.oe_list_save', this.proxy('saveEdition'));
|
.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
|
// Editor is not restartable due to formview not being
|
||||||
// restartable
|
// restartable
|
||||||
this.editor = this.makeEditor();
|
this.editor = this.makeEditor();
|
||||||
|
|
Loading…
Reference in New Issue