summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-10-04 17:57:46 +0200
committerXavier Morel <xmo@openerp.com>2011-10-04 17:57:46 +0200
commit49de0f4640cf2bfceb3c4f6c6a333739ecd866f4 (patch)
treef3bba269d2cf290d2fe240ce62d7a78b59fc5cb1 /addons/web/static/src/js
parent74db7dd027ba87e4468875634d7fb6e7fbdf7c30 (diff)
[FIX] stupidity: if insert a line in a list with more than 5 records (no padding), since the new line does not have a @data-id yet it's going to remove it immediately.
select line to remove before inserting new one bzr revid: xmo@openerp.com-20111004155746-q13ieg0q6lsy1uf7
Diffstat (limited to 'addons/web/static/src/js')
-rw-r--r--addons/web/static/src/js/view_list_editable.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js
index 41133c102d0..82365ee5942 100644
--- a/addons/web/static/src/js/view_list_editable.js
+++ b/addons/web/static/src/js/view_list_editable.js
@@ -148,7 +148,7 @@ openerp.web.list_editable = function (openerp) {
var $new_row = $('<tr>', {
id: _.uniqueId('oe-editable-row-'),
'data-id': record_id,
- 'class': $(row).attr('class') + ' oe_forms',
+ 'class': row ? $(row).attr('class') : '' + ' oe_forms',
click: function (e) {e.stopPropagation();}
})
.delegate('button.oe-edit-row-save', 'click', function () {
@@ -175,6 +175,7 @@ openerp.web.list_editable = function (openerp) {
if (row) {
$new_row.replaceAll(row);
} else if (self.options.editable) {
+ var $last_child = self.$current.find('> tr:last');
if (self.records.length) {
if (self.options.editable === 'top') {
$new_row.insertBefore(
@@ -186,7 +187,6 @@ openerp.web.list_editable = function (openerp) {
} else {
$new_row.prependTo(self.$current);
}
- var $last_child = self.$current.find('> tr:last');
if ($last_child.is(':not([data-id])')) {
$last_child.remove();
}